Unity-Technologies / ml-agents

The Unity Machine Learning Agents Toolkit (ML-Agents) is an open-source project that enables games and simulations to serve as environments for training intelligent agents using deep reinforcement learning and imitation learning.
https://unity.com/products/machine-learning-agents
Other
16.93k stars 4.14k forks source link

'mlagents-learn' is not recognized as an internal or external command, operable program or batch file. #2304

Closed XanderKehoe closed 4 years ago

XanderKehoe commented 5 years ago

Im following this tutorial (https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Basic-Guide.md) and I am at the "Training the Environment" section. When I get to step 3/4, I input the given commands into my command line but I am met with:

"'mlagents-learn' is not recognized as an internal or external command, operable program or batch file."

How to fix?

ervteng commented 5 years ago

Hi @thekiwininja99, did you follow the install instructions? You may have to activate your virtual environment before the command works.

https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Installation.md

XanderKehoe commented 5 years ago

Re-installed the entire process and got a step further, but now I get an error running the command:

"Traceback (most recent call last): File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 14, in swig_import_helper return importlib.import_module(mname) File "C:\Users\MyName.conda\envs\ml-agents\lib\importlib__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 658, in _load_unlocked File "", line 571, in module_from_spec File "", line 922, in create_module File "", line 219, in _call_with_frames_removed ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 16, in swig_import_helper return importlib.import_module('_pywrap_tensorflow_internal') File "C:\Users\MyName.conda\envs\ml-agents\lib\importlib__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\MyName.conda\envs\ml-agents\Scripts\mlagents-learn-script.py", line 11, in load_entry_point('mlagents', 'console_scripts', 'mlagents-learn')() File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packages\pkg_resources__init.py", line 489, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packages\pkg_resources__init.py", line 2843, in load_entry_point return ep.load() File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packages\pkg_resources__init__.py", line 2434, in load return self.resolve() File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packages\pkg_resources\init.py", line 2440, in resolve module = import__(self.module_name, fromlist=['name'], level=0) File "c:\users\MyName\downloads\ml-agents-master\ml-agents-master\ml-agents\mlagents\trainers__init.py", line 5, in from .models import * File "c:\users\MyName\downloads\ml-agents-master\ml-agents-master\ml-agents\mlagents\trainers\models.py", line 4, in import tensorflow as tf File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packages\tensorflow\init.py", line 24, in from tensorflow.python import * # pylint: disable=redefined-builtin File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packages\tensorflow\python\init__.py", line 49, in from tensorflow.python import pywrap_tensorflow File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 14, in swig_import_helper return importlib.import_module(mname) File "C:\Users\MyName.conda\envs\ml-agents\lib\importlib\init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 658, in _load_unlocked File "", line 571, in module_from_spec File "", line 922, in create_module File "", line 219, in _call_with_frames_removed ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 16, in swig_import_helper return importlib.import_module('_pywrap_tensorflow_internal') File "C:\Users\MyName.conda\envs\ml-agents\lib\importlib__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions. Include the entire stack trace above this error message when asking for help."

xiaomaogy commented 5 years ago

I think you haven't installed the tensorflow correctly. Following the tensorflow guide and install 1.7.1 would be what you want.

harperj commented 4 years ago

We are closing this issue due to inactivity. Feel free to reopen it if you’d like to continue the discussion.

github-actions[bot] commented 3 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.