flightmare icon indicating copy to clipboard operation
flightmare copied to clipboard

Example not running - ModuleNotFound

Open EceChaik opened this issue 3 years ago • 5 comments

Hi everyone,

I just went through the installation instructions in the wiki, and after installing everything, I run the proposed example python3 run_drone_control.py --train 0

But I get the following error: python3 run_drone_control.py --train 0 2021-03-19 14:14:08.561713: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0 Traceback (most recent call last): File "run_drone_control.py", line 12, in from stable_baselines import logger File "/home/dc4204/anaconda3/envs/Flightmare/lib/python3.6/site-packages/stable_baselines/init.py", line 6, in from stable_baselines.deepq import DQN File "/home/dc4204/anaconda3/envs/Flightmare/lib/python3.6/site-packages/stable_baselines/deepq/init.py", line 1, in from stable_baselines.deepq.policies import MlpPolicy, CnnPolicy, LnMlpPolicy, LnCnnPolicy File "/home/dc4204/anaconda3/envs/Flightmare/lib/python3.6/site-packages/stable_baselines/deepq/policies.py", line 2, in import tensorflow.contrib.layers as tf_layers ModuleNotFoundError: No module named 'tensorflow.contrib'

Any help appreciated, thanks

EceChaik avatar Mar 19 '21 10:03 EceChaik

make sure you install the right version of tensorflow, which should be tensorlfow <1.18

yun-long avatar Mar 19 '21 14:03 yun-long

Hi, thanks for the swift reply.

So what I did now was

pip uninstall tensorflow pip install tensorflow==1.15 then again I run cd flightlib ; pip install . cd flightrl ; pip install . cd examples ; python3 run_drone_control.py --train 0

This time the output was: WARNING:tensorflow: The TensorFlow contrib module will not be included in TensorFlow 2.0. For more information, please see:

  • https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
  • https://github.com/tensorflow/addons
  • https://github.com/tensorflow/io (for I/O related ops) If you depend on functionality not listed there, please file an issue.

Traceback (most recent call last): File "run_drone_control.py", line 15, in from rpg_baselines.common.policies import MlpPolicy ModuleNotFoundError: No module named 'rpg_baselines.common'

EceChaik avatar Mar 19 '21 14:03 EceChaik

I've faced the same issue (ModuleNotFoundError: No module named 'rpg_baselines.common').

Just replace packages=['rpg_baselines'], in the file path_to_flightmare/flightrl/setup.py by packages=['rpg_baselines', 'rpg_baselines.ppo', 'rpg_baselines.common', 'rpg_baselines.envs'], and then cd flightrl ; pip install .

fixed it for me.

I hope this will help you. Good luck.

ouafi98 avatar Mar 20 '21 21:03 ouafi98

Thanks a lot, it fixed it for me as well.

EceChaik avatar Mar 21 '21 08:03 EceChaik

Traceback (most recent call last): File "run_drone_control.py", line 21, in from flightgym import QuadrotorEnv_v1 ModuleNotFoundError: No module named 'flightgym'

can someone help me please

samaila53 avatar Aug 04 '23 16:08 samaila53