question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error running Keras entailment example

See original GitHub issue

Hi Guys I’m trying to run the Parikh example, and when running the test using

py.test keras_parikh_entailment/keras_decomposable_attention.py

I get an error

ValueError: You calledset_weights(weights) on layer "embed" with a weight list of length 1, but the layer was expecting 0 weights. Provided weights: [array([[ 0.00000000e+00, 0.00000000e+00, 1.4...

I’ve tried a couple of different environments (python 2.7 and 3.5, CPU & GPU).

I updated to the most recent versions of Keras and Spacy. Tried on both Mac and Ubuntu.

Thanks

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:22 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
FernandoTNcommented, Mar 22, 2017

Running into some issues when trying to run both tests,

TypeError: call() got an unexpected keyword argument 'mask'

../../../anaconda/lib/python3.6/site-packages/Keras-2.0.2-py3.6.egg/keras/engine/topology.py:554: TypeError
4reactions
Nicortcommented, Apr 1, 2017

The TypeError is coming from these two lines (181 & 182) of code in keras_decomposable_attention.py:

    avged = GlobalAveragePooling1D()(result, mask=self.words)
    maxed = GlobalMaxPooling1D()(result, mask=self.words)

changing it to:

    avged = GlobalAveragePooling1D()(result)  #mask=self.words
    maxed = GlobalMaxPooling1D()(result) #mask=self.words

fixes the issue and gets the tests to pass:

errorcorrect

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trying to run Spacy Textual entailment example and getting a ...
Trying to run Spacy Textual entailment example and getting a value error (keras) ... Hi guys I'm trying to run the spacy example...
Read more >
Multimodal entailment - Keras
In this example, we will build and train a model for predicting multimodal entailment. We will be using the multimodal entailment dataset ...
Read more >
Textual entailment with TensorFlow - O'Reilly
This occurs when the first sentence can be used to disprove the second sentence.
Read more >
How to Reduce Generalization Error With Activity ...
In this tutorial, you will discover the Keras API for adding activity regularization to deep learning neural network models.
Read more >
Error while running keras - General - RStudio Community
Hello. I run the followng code: model <- keras_model_sequential() %>% layer_gru(units = 32, dropout = 0.1, recurrent_dropout = 0.5, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found