I found in another post that tensorflow and keras use as default gpu when there is. Then there is no need for.to() method.
My problem was i didn’t cuda and cudnn install on docker. I fixed using the gpu version of tensorflow and keras.
1 Like