keras version: '1.1.2'
tensorflow version: '0.12.0-rc1'
python version: '2.7.12'
The error is the following:
Traceback (most recent call last):
File "model.py", line 28, in <module>
x = UpSampling1D()(x)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 517, in __call__
self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 571, in add_inbound_node
Node.create_node(self, inbound_layers, node_indices, tensor_indices)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 155, in create_node
output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0]))
File "/usr/local/lib/python2.7/dist-packages/keras/layers/convolutional.py", line 1273, in call
output = K.repeat_elements(x, self.length, axis=1)
File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 830, in repeat_elements
splits = tf.split(axis, x_shape[axis], x)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 1159, in split
name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_array_ops.py", line 3241, in _split
num_split=num_split, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 675, in apply_op
attr_value.i = _MakeInt(value, key)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 155, in _MakeInt
(arg_name, repr(v)))
TypeError: Expected int for argument 'num_split' not None.
And my code is the following:
# X shape is (128 1292)
input_img = Input(shape=(X.shape[0], X.shape[1]))
x = Convolution1D(256, 3, activation='relu')(input_img)
x = MaxPooling1D()(x)
x = Convolution1D(256, 3, activation='relu')(x)
x = MaxPooling1D()(x)
x = Convolution1D(256, 3, activation='relu')(x)
x = MaxPooling1D()(x)
encoded = LSTM(X.shape[0])(x)
x = RepeatVector(X.shape[0])(encoded)
x = LSTM(X.shape[1], return_sequences=True)(x)
x = Convolution1D(256, 3, activation='relu')(x)
x = UpSampling1D()(x)
x = Convolution1D(256, 3, activation='relu')(x)
x = UpSampling1D()(x)
x = Convolution1D(256, 3, activation='relu')(x)
x = UpSampling1D()(x)
decoded = Convolution1D(256, 3, activation='sigmoid')(x)
autoencoder = Model(input_img, decoded)
autoencoder.compile(optimizer='adam', loss='mse')
Any idea into why the error is being generated? I lookup online and it seems the same error was corrected and should be no longer present in the recent versions I am using.
Hi, I am trying to create a autoencoder similar to the one in the keras blog https://blog.keras.io/building-autoencoders-in-keras.html my setup is the following:
The error is the following:
And my code is the following:
Any idea into why the error is being generated? I lookup online and it seems the same error was corrected and should be no longer present in the recent versions I am using.
Thanks!