Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

InputShape as a list is broken in latest keras (2.0.4) #330

Closed
avr248 opened this issue May 1, 2017 · 8 comments
Closed

InputShape as a list is broken in latest keras (2.0.4) #330

avr248 opened this issue May 1, 2017 · 8 comments

Comments

@avr248
Copy link

avr248 commented May 1, 2017

AttributeError: 'list' object has no attribute 'shape'
Exception ignored in: <bound method BaseSession.del of <tensorflow.python.client.session.Session object at 0x1211e8c18>>
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 582, in del
AttributeError: 'NoneType' object has no attribute 'TF_DeleteStatus'

@nelson-liu
Copy link
Contributor

Can you give some more details about where you are seeing this and how to reproduce?

@avr248
Copy link
Author

avr248 commented May 1, 2017

python3 scripts/run_model.py params/sentence_selection/siamese_sentence_selector_squad.json

2017-05-01 15:16:37,981 - PARAM - deep_qa.common.params - seq2seq_encoder.default.encoder_params.type = bi_gru
2017-05-01 15:16:37,982 - PARAM - deep_qa.common.params - seq2seq_encoder.default.encoder_params.l2_regularization = None
2017-05-01 15:16:37,982 - PARAM - deep_qa.common.params - seq2seq_encoder.default.encoder_params.l1_regularization = None
Traceback (most recent call last):
File "scripts/run_model.py", line 66, in
main()
File "scripts/run_model.py", line 54, in main
model.train()
File "scripts/../deep_qa/training/trainer.py", line 283, in train
self.model = self._build_model()
File "scripts/../deep_qa/models/sentence_selection/siamese_sentence_selector.py", line 83, in _build_model
modeled_question = hidden_layer(modeled_question)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/keras/engine/topology.py", line 585, in call
output = self.call(inputs, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/keras/layers/wrappers.py", line 263, in call
y = self.forward_layer.call(inputs, **kwargs)
File "scripts/../deep_qa/layers/encoders/shareable_gru.py", line 12, in call
self.input_spec = InputSpec(shape=(self.input_spec.shape[0],
AttributeError: 'list' object has no attribute 'shape'
Exception ignored in: <bound method BaseSession.del of <tensorflow.python.client.session.Session object at 0x1211e8c18>>
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 582, in del
AttributeError: 'NoneType' object has no attribute 'TF_DeleteStatus'

@nelson-liu
Copy link
Contributor

Thanks. looks like this is broken on the current master too, and i think the culprit is the recent release of Keras 2.0.4.

Can you try downgrading to Keras 2.0.3 (pip uninstall keras && pip install keras==2.0.3)? That should work while we push a fix in the meantime / update the requirements to pin to keras 2.0.3

@avr248
Copy link
Author

avr248 commented May 1, 2017

Thank you very much. Great.

Another question: How do I handle a babi task dataset?

@nelson-liu nelson-liu changed the title error InputShape as a list is broken in latest keras (2.0.4) May 1, 2017
@nelson-liu
Copy link
Contributor

So, right now certain models support certain datasets. For example, you can use the SoftMaxMemoryNetwork model to do a babi-style task (see https://github.com/allenai/deep_qa/blob/master/example_experiments/memory_networks/babi_experiment.json, this experiment config might be out of date).

@matt-gardner or @DeNeutoy are probably more familiar with the memory network code and might be able to comment more about this, but can you be a bit more specific with your question? Are you looking to simply solve tasks from bAbI?

@avr248
Copy link
Author

avr248 commented May 1, 2017

in need py script for preprocessed data

@matt-gardner
Copy link
Contributor

Thanks, @nelson-liu, for helping with this. This issue makes me wonder if we should have some kind of checklist for issues, like keras and many other repos do... We really don't have the bandwidth to respond to issues that aren't stated clearly, now that it's just me and Mark.

@avr248, see here for info on processing the data.

@nelson-liu
Copy link
Contributor

Yes, an issue template sounds like a good idea

matt-gardner added a commit to matt-gardner/deep_qa that referenced this issue May 16, 2017
matt-gardner added a commit to matt-gardner/deep_qa that referenced this issue May 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants