EderSantana / seya

Bringing up some extra Cosmo to Keras.
Other
377 stars 103 forks source link

problems while testing the conv_rnn & conv_gru #58

Closed anotherTK closed 6 years ago

anotherTK commented 6 years ago

hey, guys. I tested the conv_rnn module under keras and tensorflow as the backend, using the test code nb_samples, timesteps, ndim, filter_dim = 5, 10, 28, 3 input_flat = ndim ** 2 layer = ConvRNN(filter_dim=(1, filter_dim, filter_dim), reshape_dim=(1, ndim, ndim), input_shape=(timesteps, input_flat), return_sequences=True) model = Sequential() model.add(layer)

while some problems encountered below:


TypeError Traceback (most recent call last)

in () 21 return_sequences=True) 22 model = Sequential() ---> 23 model.add(layer) /home/tk/.conda/envs/keras/lib/python2.7/site-packages/keras/models.pyc in add(self, layer) 462 # and create the node connecting the current layer 463 # to the input layer we just created. --> 464 layer(x) 465 466 if len(layer.inbound_nodes[-1].output_tensors) != 1: /home/tk/.conda/envs/keras/lib/python2.7/site-packages/keras/legacy/layers.pyc in __call__(self, inputs, initial_state, **kwargs) 960 # modify the input spec to include the state. 961 if initial_state is None: --> 962 return super(Recurrent, self).__call__(inputs, **kwargs) 963 964 if not isinstance(initial_state, (list, tuple)): /home/tk/.conda/envs/keras/lib/python2.7/site-packages/keras/engine/topology.pyc in __call__(self, inputs, **kwargs) 574 '`layer.build(batch_input_shape)`') 575 if len(input_shapes) == 1: --> 576 self.build(input_shapes[0]) 577 else: 578 self.build(input_shapes) TypeError: build() takes exactly 1 argument (2 given) Is there anybody knows whats going on?
EderSantana commented 6 years ago

Hi, please notice that keras now has built in convolutional rnns https://github.com/keras-team/keras/blob/master/keras/layers/convolutional_recurrent.py Also, you should that instead since it is better maintained in recent keras versions.