Comments (8)
Can you try installing gym using pip install gym[all]
from ddpg-keras-torcs.
can you try installing keras with the specified version and try executing the code
sudo pip install keras==1.1.0
from ddpg-keras-torcs.
Please try to install keras 1.1.0 as
sudo pip install keras==1.1.0
and
tensorflow as
sudo pip install tensorflow==0.12.0r0
Hope this will solve your issue
from ddpg-keras-torcs.
ratheesh2107,Thank you!
from ddpg-keras-torcs.
Thank you ratheesh2107,After I installed gym, the ImportError: No module named 'gym' dissapeared.But I am faced with some new erro>>
(tensorflow) terry@terry:~/gym_torcs$ python ddpg.py
Using TensorFlow backend.
Traceback (most recent call last):
File "ddpg.py", line 10, in
from keras.engine.training import collect_trainable_weights
ImportError: cannot import name 'collect_trainable_weights'
How should I solve this?please help me .many thanks
from ddpg-keras-torcs.
Really sorry to bother again,After executing the code sudo pip install keras==1.1.0.I got this error
:TypeError: Expected int32, got list containing Tensors of type '_Message' instead.
I googled it,and it turned out I used the wrong version of Tensorflow. I should use Tensorflow r0.10 as
yanpanlau recommended .I went to the Tensorflow website ,but there is no instructions on how to install
Tensorflow r0.10.I installed the newest Tensorflow using Virtualenv. BTW ,I'am using a virtual machine,I don't have any NVIDIA GTX series GPU.
Here's the detail:
terry@terry:$ cd gym_torcs/gym_torcs$ source
terry@terry:/tensorflow/bin/activate/gym_torcs$ python ddpg.py
(tensorflow) terry@terry:
Using TensorFlow backend.
2018-07-04 15:53:28.706468: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Now we build the model
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/terry/gym_torcs/ActorNetwork.py", line 25, in init
self.model , self.weights, self.state = self.create_actor_network(state_size, action_size)
File "/home/terry/gym_torcs/ActorNetwork.py", line 54, in create_actor_network
V = merge([Steering,Acceleration,Brake],mode='concat')
File "/usr/local/lib/python3.5/dist-packages/keras/engine/topology.py", line 1528, in merge
name=name)
File "/usr/local/lib/python3.5/dist-packages/keras/engine/topology.py", line 1188, in init
self.add_inbound_node(layers, node_indices, tensor_indices)
File "/usr/local/lib/python3.5/dist-packages/keras/engine/topology.py", line 572, in add_inbound_node
Node.create_node(self, inbound_layers, node_indices, tensor_indices)
File "/usr/local/lib/python3.5/dist-packages/keras/engine/topology.py", line 154, in create_node
output_tensors = to_list(outbound_layer.call(input_tensors, mask=input_masks))
File "/usr/local/lib/python3.5/dist-packages/keras/engine/topology.py", line 1275, in call
return K.concatenate(inputs, axis=self.concat_axis)
File "/usr/local/lib/python3.5/dist-packages/keras/backend/tensorflow_backend.py", line 716, in concatenate
return tf.concat(axis, [to_dense(x) for x in tensors])
File "/home/terry/tensorflow/lib/python3.5/site-packages/tensorflow/python/ops/array_ops.py", line 1186, in concat
dtype=dtypes.int32).get_shape().assert_is_compatible_with(
File "/home/terry/tensorflow/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1014, in convert_to_tensor
as_ref=False)
File "/home/terry/tensorflow/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1104, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/home/terry/tensorflow/lib/python3.5/site-packages/tensorflow/python/framework/constant_op.py", line 235, in _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
File "/home/terry/tensorflow/lib/python3.5/site-packages/tensorflow/python/framework/constant_op.py", line 214, in constant
value, dtype=dtype, shape=shape, verify_shape=verify_shape))
File "/home/terry/tensorflow/lib/python3.5/site-packages/tensorflow/python/framework/tensor_util.py", line 432, in make_tensor_proto
_AssertCompatible(values, dtype)
File "/home/terry/tensorflow/lib/python3.5/site-packages/tensorflow/python/framework/tensor_util.py", line 343, in _AssertCompatible
(dtype.name, repr(mismatch), type(mismatch).name))
TypeError: Expected int32, got list containing Tensors of type '_Message' instead.
(tensorflow) terry@terry:~/gym_torcs$
from ddpg-keras-torcs.
@ratheesh2107 I was getting the same error. So I followed your steps and below is the update.
Completed successfully
sudo pip install keras==1.1.0
Tensorflow not successful, error details are
kk@kk-Lenovo-ideapad-320-15ISK:~/gym_torcs$ sudo pip install tensorflow==0.12.0r0
The directory '/home/kk/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/kk/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting tensorflow==0.12.0r0
Could not find a version that satisfies the requirement tensorflow==0.12.0r0 (from versions: 0.12.0rc0, 0.12.0rc1, 0.12.0, 0.12.1, 1.0.0, 1.0.1, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2, 1.1.0, 1.2.0rc0, 1.2.0rc1, 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.4.1, 1.5.0rc0, 1.5.0rc1, 1.5.0, 1.5.1, 1.6.0rc0, 1.6.0rc1, 1.6.0, 1.7.0rc0, 1.7.0rc1, 1.7.0, 1.7.1, 1.8.0rc0, 1.8.0rc1, 1.8.0, 1.9.0rc0, 1.9.0rc1, 1.9.0rc2, 1.9.0, 1.10.0rc0, 1.10.0rc1, 1.10.0)
No matching distribution found for tensorflow==0.12.0r0
Could you please help me to fix this.
Thank you,
KK
from ddpg-keras-torcs.
You can add path just before calling gym. Something like this:
import sys
sys.path.append("/home/user_name/gym/") #we can add directory of your gym folder
import gym
I hope it will fix the problem.
from ddpg-keras-torcs.
Related Issues (20)
- Episode error HOT 4
- The train problem! HOT 2
- The run errors! HOT 2
- how to use GPU when training
- Text mode is the only way to accelerate the training process? HOT 6
- Thank you for your answer, thank you very much.
- My agent does not learn any reasonable policy At ALL.
- Getting error HOT 1
- Terminal state problem
- ValueError: Output tensors to a Model must be the output of a Keras `Layer` (thus holding past layer metadata). Found: <keras.layers.merge.Concatenate object at 0x7fe49425c5f8>
- ValueError: Shapes (3, ?, 1) and () are incompatible HOT 4
- i have a mistake when i install the torcs, it's confused. HOT 1
- Time required to train HOT 3
- How to run the car for a full lap
- the agent stopped taking any actions while the training still running HOT 1
- I need your help
- The agent has been rebooting!
- Modify the attributes of added vehicles in "quick race".
- The weights provided don't perform well, the car run about just 6 secs and go the wrong way, then it stopped, should i need to trained from scratch?
- The generated image does not contain the information of the entire interface HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ddpg-keras-torcs.