Giter VIP home page Giter VIP logo

Comments (8)

ratheesh2107 avatar ratheesh2107 commented on August 23, 2024 2

Can you try installing gym using pip install gym[all]

from ddpg-keras-torcs.

ratheesh2107 avatar ratheesh2107 commented on August 23, 2024 1

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.

ratheesh2107 avatar ratheesh2107 commented on August 23, 2024 1

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.

slimterry avatar slimterry commented on August 23, 2024 1

ratheesh2107,Thank you!

from ddpg-keras-torcs.

slimterry avatar slimterry commented on August 23, 2024

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.

slimterry avatar slimterry commented on August 23, 2024

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
terry@terry:
/gym_torcs$ source /tensorflow/bin/activate
(tensorflow) terry@terry:
/gym_torcs$ python ddpg.py
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.

kk2491 avatar kk2491 commented on August 23, 2024

@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.

rafailislam avatar rafailislam commented on August 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.