Closed yongqianxiao closed 3 years ago
The model class is a layer object. And your V is obviously not a tensor but it needs a tensor. model=Model(input=S, output=[Steering, Acceleration, Brake])
when you run this, you are giving it a tensor so it works. Your second problem is probably a tensorflow problem just use the same keras gradient function and try to use it again. I will make a pull request to fix your first error.
EDIT: looks like some of the functions of the repo you are trying to build are deprecated.
Best, Leon
Hi yongqianxiao
When i look in documentation for the functional API i see "concatenate" not "Concatenate" https://keras.io/getting-started/functional-api-guide/
When i did this change on my network it started training, and the models converge
I also received this error when running the code locally (pulled down from this repo and ran without any modifications). However, the same code works fine when running on Colab.
In order to get this code to run locally I changed the code as follows as it worked. Thank you @ThomasHenckel for identifying this issue.
From this:
concat = layers.Concatenate()([state_out, action_out])
To this:
concat = layers.concatenate([state_out, action_out])
Please make sure that this is a Bug or a Feature Request and provide all applicable information asked by the template. If your issue is an implementation question, please ask your question on StackOverflow or on the Keras Slack channel instead of opening a GitHub issue.
System information
You can obtain the TensorFlow version with: "b'v1.13.1-0-g6612da8951'", 1.13.1' python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"
You can obtain the Keras version with: 2.2.4 python -c 'import keras as k; print(k.version)'
Describe the current behavior
the code is from DDPG TORCS
when I run the code, the fellow line raise a error:
when I change the line to
model=Model(input=S, output=[Steering, Acceleration, Brake])
, then that line code is well, but another line code raise a error:can someone help me to solve the problem, it just spend me a whole day. Describe the expected behavior
Code to reproduce the issue
Provide a reproducible test case that is the bare minimum necessary to generate the problem.
Other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.