Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more

crowdAI is shutting down - please read our blog post for more information

NIPS 2017: Learning to Run

Reinforcement learning environments with musculoskeletal models


example.py error

Posted by saikrishnagv almost 2 years ago

Hello, I am following the instructions given on “Getting started” . When I try to run the example.py, (as given on the 4th page), it gave me the following error: “ Using TensorFlow backend. Traceback (most recent call last): File “example.py”, line 6, in from keras.models import Sequential, Model File "/home/sai/anaconda3/envs/opensim-rl/lib/python3.6/site-packages/keras/__init__.py", line 3, in from . import utils File "/home/sai/anaconda3/envs/opensim-rl/lib/python3.6/site-packages/keras/utils/__init__.py", line 6, in from . import conv_utils File "/home/sai/anaconda3/envs/opensim-rl/lib/python3.6/site-packages/keras/utils/conv_utils.py", line 3, in from .. import backend as K File "/home/sai/anaconda3/envs/opensim-rl/lib/python3.6/site-packages/keras/backend/__init__.py", line 83, in from .tensorflow_backend import * File "/home/sai/anaconda3/envs/opensim-rl/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 1, in import tensorflow as tf ModuleNotFoundError: No module named 'tensorflow' " I don't understand the reason for this, as I have installed everything exactly as given in the instructions. Should I install tensorflow packages separately now? or, Am I missing something here? Thank you!!


Posted by spMohanty  almost 2 years ago |  Quote

Hi @saikrishnagv,

I do all my tests using anaconda2 (python 2.7 ), where everything works out of the box smoothly. it seems you are using anaconda3 (python 3.* version). You can either try installing tensorflow and checking it works, or try the whole setup again using anaconda2 (python 2.7 version). In any case osim-rl is completely decoupled from the keras backed (which in this case is trying to load tensorflow) , so as long as you can do a python -c "import osim" ; you should be good to start running experiments on your choice of framework (after installing them).

Cheers, Mohanty

Posted by JayKanidan  almost 2 years ago |  Quote

Most probably you need to “source activate opensim-rl” Looks like the environment is pointing to python3.6 but by installation, it should be 2.7.

Posted by Chetan  almost 2 years ago |  Quote


were u able to solve this problem. I also got similar error for example.py

Posted by Chetan  almost 2 years ago |  Quote

I recreated the environment and it worked. I am not sure why it referred to tensorflow earlier.