Closed socathie closed 6 years ago
File "/share1/anaconda3/envs/tensorflow-gpu/lib/python3.5/site-packages/keras/backend/theano_backend.py", line 310, in ones return variable(np.ones(shape), dtype, name)
Oh Theano. This occurs because Theano does not support a Tensor for its shape definition. It delegates the tensor building to Numpy first, and then wraps that ndarray into a Theano tensor.
Since batch size is unknown at model building time (it is generally set to None), therefore there is no way to pass the shape [batch_size, dim3] to the numpy array dynamically.
This needs a fix in the Keras backend, or a rewrite of the code + specifying a static batch size for the input shape in order to work on Theano.
I would suggest working with TF or CNTK for now.
Tried remaining in Theano and use Input(batch_shape=(batch_size,x,y,z,1)) instead. Still didn't work. I guess I would have to switch to TF
It would require a rewrite of the script as well, removing all of the K.stack() and only passing the shape arrays directly.
I just added a theano specific version of the script, called coord_theano.py
. I think that may work, combined with a static batch shape.
I encounter the following error when running on GPU (using Theano) with a 3D single-channel input, the same model compiles fine on my personal laptop (using Tensorflow).
It seems like a problem when using Theano backend..