-
Notifications
You must be signed in to change notification settings - Fork 267
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
Someting error when running on Keras2.0.3 #17
Comments
The code was only test with Python 2.7, tensorflow 0.12 and Keras version
1.x (which is the latest version as of Oct 2016).
I heard there are many new changes in Keras 2.0 and Tensorflow 1.x so
probably not compatible.
I will need a bit time to re-write under the latest version.
Thanks for your kind understanding.
[Or you can just setup an virtual environment and install the old version,
I am sure it will work]
…On Wed, Apr 12, 2017 at 7:23 PM, xiaoguai0992 ***@***.***> wrote:
When I tried your code under Keras2.0.3 and tensorflow1.0.1 backend, some
error occurs.
Python version is 3.6
Which part should I modify if I want to run it correctly and why?
Thanks a lot.
Here are the detail imformation:
Traceback (most recent call last):
File "ddpg.py", line 162, in
playGame()
File "ddpg.py", line 52, in playGame
actor = ActorNetwork(sess, state_dim, action_dim, BATCH_SIZE, TAU, LRA)
File "/home/test/gym_torcs/ActorNetwork.py", line 25, in *init*
self.model , self.weights, self.state = self.create_actor_network(state_size,
action_size)
File "/home/test/gym_torcs/ActorNetwork.py", line 51, in
create_actor_network
Steering = Dense(1,activation='tanh',init=lambda shape, name:
normal(shape, scale=1e-4, name=name))(h1)
File "/home/test/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py",
line 551, in *call*
self.build(input_shapes[0])
File "/home/test/anaconda3/lib/python3.6/site-packages/keras/layers/core.py",
line 827, in build
constraint=self.kernel_constraint)
File "/home/test/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py",
line 384, in add_weight
weight = K.variable(initializer(shape), dtype=K.floatx(), name=name)
TypeError: () missing 1 required positional argument: 'name'
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#17>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AO1sY_guZDrIT1aGh67cIkF3iHnNN-ujks5rvLQagaJpZM4M7SpL>
.
|
I solved it by changing part of your code. At ActionNetwork.py: Replace Steering = Dense(.... and following 3 lines Dense call with and from keras.initializers import VarianceScaling then the code works correctly. |
I was facing this keras(2.0.5) and tensorflow (gpu 1.2.1) version mismatch problem too. And I replaced what you did, and it stoped error, but it keeps relauching torcs, I am not sure it is training?? |
Could someone elaborate on what the lines |
When I tried your code under Keras2.0.3 and tensorflow1.0.1 backend, some error occurs.
Python version is 3.6
Which part should I modify if I want to run it correctly and why?
Thanks a lot.
Here are the detail imformation:
Traceback (most recent call last):
File "ddpg.py", line 162, in
playGame()
File "ddpg.py", line 52, in playGame
actor = ActorNetwork(sess, state_dim, action_dim, BATCH_SIZE, TAU, LRA)
File "/home/test/gym_torcs/ActorNetwork.py", line 25, in init
self.model , self.weights, self.state = self.create_actor_network(state_size, action_size)
File "/home/test/gym_torcs/ActorNetwork.py", line 51, in create_actor_network
Steering = Dense(1,activation='tanh',init=lambda shape, name: normal(shape, scale=1e-4, name=name))(h1)
File "/home/test/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 551, in call
self.build(input_shapes[0])
File "/home/test/anaconda3/lib/python3.6/site-packages/keras/layers/core.py", line 827, in build
constraint=self.kernel_constraint)
File "/home/test/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 384, in add_weight
weight = K.variable(initializer(shape), dtype=K.floatx(), name=name)
TypeError: () missing 1 required positional argument: 'name'
The text was updated successfully, but these errors were encountered: