obstacle-tower-env icon indicating copy to clipboard operation
obstacle-tower-env copied to clipboard

ModuleNotFoundError mlagents_envs'

Open BhaskarTrivedi opened this issue 6 years ago • 2 comments

ModuleNotFoundError Traceback (most recent call last) in ----> 1 from obstacle_tower_env import ObstacleTowerEnv 2 get_ipython().run_line_magic('matplotlib', 'inline') 3 from matplotlib import pyplot as plt

~/obstacle-tower-env/obstacle_tower_env.py in 4 import gym 5 import numpy as np ----> 6 from mlagents_envs import UnityEnvironment 7 from gym import error, spaces 8 import os

ModuleNotFoundError: No module named 'mlagents_envs'

Pip freeze MarkupSafe 1.1.1
matplotlib 3.0.3
mistune 0.8.4
mlagents 0.6.2 /home/user/ml-agents/ml-agents
mlagents-envs 0.6.2 /home/user/ml-agents/ml-agents-envs more-itertools 7.0.0
nbconvert 5.4.1
nbformat 4.4.0
notebook 5.7.8
numpy 1.14.5
obstacle-tower-env 1.3 /home/bhaskartrivedi/obstacle-tower-env
pandocfilters 1.4.2
parso 0.4.0

output of mlagents-learn --help mlagents-learn --help

                    ▄▄▄▓▓▓▓
               ╓▓▓▓▓▓▓█▓▓▓▓▓
          ,▄▄▄m▀▀▀'  ,▓▓▓▀▓▓▄                           ▓▓▓  ▓▓▌
        ▄▓▓▓▀'      ▄▓▓▀  ▓▓▓      ▄▄     ▄▄ ,▄▄ ▄▄▄▄   ,▄▄ ▄▓▓▌▄ ▄▄▄    ,▄▄
      ▄▓▓▓▀        ▄▓▓▀   ▐▓▓▌     ▓▓▌   ▐▓▓ ▐▓▓▓▀▀▀▓▓▌ ▓▓▓ ▀▓▓▌▀ ^▓▓▌  ╒▓▓▌
    ▄▓▓▓▓▓▄▄▄▄▄▄▄▄▓▓▓      ▓▀      ▓▓▌   ▐▓▓ ▐▓▓    ▓▓▓ ▓▓▓  ▓▓▌   ▐▓▓▄ ▓▓▌
    ▀▓▓▓▓▀▀▀▀▀▀▀▀▀▀▓▓▄     ▓▓      ▓▓▌   ▐▓▓ ▐▓▓    ▓▓▓ ▓▓▓  ▓▓▌    ▐▓▓▐▓▓
      ^█▓▓▓        ▀▓▓▄   ▐▓▓▌     ▓▓▓▓▄▓▓▓▓ ▐▓▓    ▓▓▓ ▓▓▓  ▓▓▓▄    ▓▓▓▓`
        '▀▓▓▓▄      ^▓▓▓  ▓▓▓       └▀▀▀▀ ▀▀ ^▀▀    `▀▀ `▀▀   '▀▀    ▐▓▓▌
           ▀▀▀▀▓▄▄▄   ▓▓▓▓▓▓,                                      ▓▓▓▓▀
               `▀█▓▓▓▓▓▓▓▓▓▌
                    ¬`▀▀▀█▓

    
Usage:
  mlagents-learn <trainer-config-path> [options]
  mlagents-learn --help

Options:
  --env=<file>               Name of the Unity executable [default: None].
  --curriculum=<directory>   Curriculum json directory for environment [default: None].
  --keep-checkpoints=<n>     How many model checkpoints to keep [default: 5].
  --lesson=<n>               Start learning from this lesson [default: 0].
  --load                     Whether to load the model or randomly initialize [default: False].
  --run-id=<path>            The directory name for model and summary statistics [default: ppo].
  --num-runs=<n>             Number of concurrent training sessions [default: 1].
  --save-freq=<n>            Frequency at which to save model [default: 50000].
  --seed=<n>                 Random seed used for training [default: -1].
  --slow                     Whether to run the game at training speed [default: False].
  --train                    Whether to train model, or only run inference [default: False].
  --base-port=<n>            Base port for environment communication [default: 5005].
  --num-envs=<n>             Number of parallel environments to use for training [default: 1]
  --docker-target-name=<dt>  Docker volume to store training-specific files [default: None].
  --no-graphics              Whether to run the environment in no-graphics mode [default: False].
  --debug                    Whether to run ML-Agents in debug mode with detailed logging [default: False].

BhaskarTrivedi avatar Apr 20 '19 21:04 BhaskarTrivedi

Hello @BhaskarTrivedi

Can you explain what you are trying to run?

awjuliani avatar Apr 22 '19 17:04 awjuliani

I was runnning obstacle tower competion and created latest unity environment from git. using command mentioned on unity ml-agent git I followed command cd ml-agents-envs pip install -e ./ cd .. cd ml-agents pip install -e ./

I dig more and found the issue mine /home/anaconda3/envs/ml-agents/lib/python3.6/site-packages has no directory mlagents_envs.. it should be there after following pip with -e ./ command which should create and copy required file and directory to your venv.

To solve the issue I manually created mlagents_envs and copy required file and directory but it should be done using pip command mentioned in ml-agent installation guide.

I used following command to create conda venv conda create -n ml-agents python=3.6 pip install tensorflow==1.7.1

Note : In above pip list command you can see mlagent version as 6.2 because to support obstacle tower i modified verison to 6.2 manually. Version update has no impact with issue as i observed same issue with unchanged setup.py file

BhaskarTrivedi avatar Apr 25 '19 16:04 BhaskarTrivedi