qlearning4k icon indicating copy to clipboard operation
qlearning4k copied to clipboard

two example not work

Open RozenAstrayChen opened this issue 6 years ago • 2 comments

Hi , I have two problem in test_catch.py and test_snake.py

  • python version : Anaconda3/python3.5
  • platform : macOS
  • backend : Tensorflow

In test_catch.py

Traceback (most recent call last):
  File "test_catch.py", line 20, in <module>
    agent.train(catch, batch_size=10, nb_epoch=1000, epsilon=.1)
  File "/Users/Rozen_mac/anaconda3/lib/python3.5/site-packages/qlearning4k-0.0.1-py3.5.egg/qlearning4k/agent.py",line 62, in train
  File "/Users/Rozen_mac/anaconda3/lib/python3.5/site-packages/qlearning4k-0.0.1-py3.5.egg/qlearning4k/agent.py",line 37, in check_game_compatibility
AttributeError: 'Sequential' object has no attribute 'input_layers_node_indices'

In test_snake.py

Traceback (most recent call last):
  File "test_snake.py", line 25, in <module>
    agent.train(snake, batch_size=64, nb_epoch=10000, gamma=0.8)
  File "/Users/Rozen_mac/anaconda3/lib/python3.5/site-packages/qlearning4k-0.0.1-py3.5.egg/qlearning4k/agent.py",line 62, in train
  File "/Users/Rozen_mac/anaconda3/lib/python3.5/site-packages/qlearning4k-0.0.1-py3.5.egg/qlearning4k/agent.py",line 37, in check_game_compatibility
AttributeError: 'Sequential' object has no attribute 'input_layers_node_indices'

RozenAstrayChen avatar Jul 20 '18 07:07 RozenAstrayChen

Hey, I had no problems running the code on Linux with Tensorflow 1.4.0 and Keras 2.1.2, which version of Keras are you running on your machine?

If you are only running the tests and you do not plan on running any Multi-node-input networks, you can just comment line 37 and 38 in agent.py out, then the code should just run fine, I just tested it.

MarkusOstermayer avatar Jul 22 '18 17:07 MarkusOstermayer

Same problem

  • OS: Ubuntu 18.04 64bit
  • Python 3.6.6
  • Tensorflow 1.12.0
  • Keras 2.2.4

Zamony avatar Nov 18 '18 19:11 Zamony