input1 = Input(batch_shape=(shape[0],shape[1],I1_dim))
input2 = Input(batch_shape=(shape[0],shape[1],shape[2]-I1_dim))
test1 = LSTM(32)(input1)
test2 = LSTM(100)(input2)
encoded = Merge([input1,test2],mode='concat')
How can I fix this problem?
Thank you very much!
input1 = Input(batch_shape=(shape[0],shape[1],I1_dim))
input2 = Input(batch_shape=(shape[0],shape[1],shape[2]-I1_dim))
test1 = LSTM(32)(input1)
test2 = LSTM(100)(input2)
encoded = Merge([test1,test2],mode='concat') # put test1 not input1
Hi,
Fix what problem? You have not told us what the actual problem is.
input1 = Input(batch_shape=(shape[0],shape[1],I1_dim))
input2 = Input(batch_shape=(shape[0],shape[1],shape[2]-I1_dim))
test1 = LSTM(32)(input1)
test2 = LSTM(100)(input2)
encoded = Merge([test1,test2],mode='concat')
It has the error:
File "/home/fxt120230/Application/pycharm-community-2016.2.3/helpers/pydev/pydevd.py", line 1580, in <module> globals = debugger.run(setup['file'], None, None, is_module) File "/home/fxt120230/Application/pycharm-community-2016.2.3/helpers/pydev/pydevd.py", line 964, in run pydev_imports.execfile(file, globals, locals) # execute the script File "/home/fxt120230/Study/MSP/Research/WhisperRecognition/ETECode/isete_lib.py", line 111, in <module> AttentionSeq2Seq(output_dim=output_dim,hidden_dim=hidden_dim,I1_dim=I1_dim,output_length=output_length, batch_input_shape=(samples,input_length, input_dim)) File "/home/fxt120230/Study/MSP/Research/WhisperRecognition/ETECode/isete_lib.py", line 79, in AttentionSeq2Seq encoded = Merge([test1,test2],mode='concat') File "/usr/local/lib/python2.7/dist-packages/Keras-1.2.0-py2.7.egg/keras/engine/topology.py", line 1293, in __init__ node_indices, tensor_indices) File "/usr/local/lib/python2.7/dist-packages/Keras-1.2.0-py2.7.egg/keras/engine/topology.py", line 1317, in _arguments_validation layer_output_shape = layer.get_output_shape_at(node_indices[i]) AttributeError: 'TensorVariable' object has no attribute 'get_output_shape_at' Exception TypeError: TypeError("'NoneType' object is not callable",) in <bound method __AptDpkgPackageInfo.__del__ of <apport.packaging_impl.__AptDpkgPackageInfo instance at 0x7f75ea81b4d0>> ignored
For the functional API you have to use merge (from keras.layers), not Merge. Note the case sensitivity.