imatge-upc / detection-2016-nipsws

Hierarchical Object Detection with Deep Reinforcement Learning
http://imatge-upc.github.io/detection-2016-nipsws/
MIT License
423 stars 129 forks source link

Keras version #4

Closed recluze closed 7 years ago

recluze commented 7 years ago

Can you please point out which version of Keras is needed for this? The latest 1.1.2 gives the following error:

Exception: The shape of the input to "Flatten" is not fully defined (got (0, 7, 512). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.

Downgrading to 0.3.0 works but leads to another issue down the line in reinforcement.py:

Traceback (most recent call last):
  File "image_zooms_training.py", line 82, in <module>
    models = get_array_of_q_networks_for_pascal("0", class_object)
  File "/home/nauman/objdet/detection-2016-nipsws/scripts/reinforcement.py", line 95, in get_array_of_q_networks_for_pascal
    q_networks.append(get_q_network("0"))
  File "/home/nauman/objdet/detection-2016-nipsws/scripts/reinforcement.py", line 76, in get_q_network
    model.add(Dense(1024, init=lambda shape, name: normal(shape, scale=0.01, name=name), input_shape=(25112,)))
...
TypeError: <lambda>() takes exactly 2 arguments (1 given)
miriambellver commented 7 years ago

I used Keras 1.0.8. In the requirements.txt you can find all the versions information.

recluze commented 7 years ago

Ah, right. Thanks. Works fine with 1.0.8.