Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError: Required 2 inputs, received 3. #105

Open
kaeflint opened this issue Jul 7, 2018 · 0 comments
Open

AssertionError: Required 2 inputs, received 3. #105

kaeflint opened this issue Jul 7, 2018 · 0 comments

Comments

@kaeflint
Copy link

kaeflint commented Jul 7, 2018

I was trying out your library today as shown below:

vocab_len=1000
hidden_units = 150
getShape= Lambda(lambda a: a,output_shape=(2*hidden_units,))
in_x = Input(shape=(None,))
in_y = Input(shape=(None,))

embedding = Embedding(1000,100)
x_emb = embedding(in_x)
encoder = RecurrentSequential(readout=True,return_states=True,
                                  return_sequences=True,state_sync=True,unroll=False)
encoder.add(Dropout(0.1,input_shape=K.int_shape(x_emb)))

encoder.add(LSTMCell(hidden_units))
encoder.add(Dropout(0.1))
encoded_seq = encoder(inputs=x_emb)

But I encountered the error below:

AssertionError Traceback (most recent call last)
in ()
----> 1 encoded_seq = encoder(inputs=x_emb)

C:\ProgramData\Anaconda3\envs\py3\lib\site-packages\recurrentshop-1.0.0-py3.6.egg\recurrentshop\engine.py in call(self, inputs, initial_state, initial_readout, ground_truth, **kwargs)
474 ground_truth = self._get_optional_input_placeholder('ground_truth')
475 inputs.append(ground_truth)
--> 476 assert len(inputs) == req_num_inputs, "Required " + str(req_num_inputs) + " inputs, received " + str(len(inputs)) + "."
477 with K.name_scope(self.name):
478 if not self.built:

AssertionError: Required 2 inputs, received 3.

I tried to follow your example. I am using keras 2.2.0 with tensorflow backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant