openai / maddpg

Code for the MADDPG algorithm from the paper "Multi-Agent Actor-Critic for Mixed Cooperative-Competitive Environments"
https://arxiv.org/pdf/1706.02275.pdf
MIT License
1.6k stars 484 forks source link

when I run train.py,it shows "module 'tensorflow' has no attribute 'float32'" #5

Closed williamyuanv0 closed 6 years ago

williamyuanv0 commented 6 years ago

when I run bin/interactive.py ,it shows: WARN: gym.spaces.Box autodetected dtype as <class 'numpy.float32'>. Please provide explicit dtype. Traceback (most recent call last): File "interactive.py", line 23, in env.render() File "/home/***/anaconda3/lib/python3.6/site-packages/gym/core.py", line 111, in render raise NotImplementedError NotImplementedError

and another problem is that ,when I run train.py,it shows: runfile('/home//Desktop/maddpg-master/experiments/train.py', wdir='/home//Desktop/maddpg-master/experiments') Traceback (most recent call last): File "", line 1, in runfile('/home//Desktop/maddpg-master/experiments/train.py', wdir='/home//Desktop/maddpg-master/experiments') File "/home//anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 710, in runfile execfile(filename, namespace) File "/home//anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 101, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "/home//Desktop/maddpg-master/experiments/train.py", line 9, in import maddpg.common.tf_util as U File "/home//Desktop/maddpg-master/maddpg/common/tf_util.py", line 71, in class BatchInput(PlacholderTfInput): File "/home/***/Desktop/maddpg-master/maddpg/common/tf_util.py", line 72, in BatchInput def init(self, shape, dtype=tf.float32, name=None): AttributeError: module 'tensorflow' has no attribute 'float32'

why dose it show that "module 'tensorflow' has no attribute 'float32'"?

ryan-lowe commented 6 years ago

Hi, The bin/interactive.py bug is related to the newest versions of OpenAI gym (>=0.10). We are working to investigate this, but in the meantime just downgrade your gym version when running the code.

ThierryBayala commented 6 years ago

Hello guys. I am having almost the same problem when I tried run the "object_detection" programm using tensorflow. Here my error message:


File "", line 16, in from object_detection.utils import ops as utils_ops

File "/Applications/anaconda3/lib/python3.6/site-packages/object_detection-0.1-py3.6.egg/object_detection/utils/ops.py", line 282, in dtype=tf.float32):

AttributeError: module 'tensorflow' has no attribute 'float32'

Can someone help me to fix that error?

czcbangkai commented 6 years ago

Did you find the solution for this problem?

I also have the same problem when I ran the "object_detection" programm using tensorflow.


Update: I downgraded my TF version to 1.4 and solved this problem.

ahbon123 commented 6 years ago

same issue for me, did someone find the solution?

abatkins commented 6 years ago

I'm getting the same error as @ThierryBayala while running object_detection/exporter.py on tensorflow 1.10. I did not have this issue on Tensorflow 1.9.

aadishjoshi commented 5 years ago

anyone who is facing same difficulty as @ThierryBayala heres what i did. 1) Downgrade tensorflow to 1.9 pip install tensorflow==1.9 2) Recompiled protoc protoc object_detection/protos/*.proto --python_out=. 3) export pythonpath [If you are using Windows try gitbash for this command] export PYTHONPATH=$PYTHONPATH:pwd:pwd/slim 4) Restart the jypter notebook kernel.

lryz0612 commented 5 years ago

I downgraded my TF version to 1.9 ,but not solved this problem.

ttuanho commented 4 years ago

I downgraded my TF version to 1.9 ,but not solved this problem.

Same but this solved similar issue on my machine: https://stackoverflow.com/questions/51654346/attributeerror-module-tensorflow-has-no-attribute-float32 I have

mac os catalina 10.15.2
python 3.6.9