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?
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
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-packagestensorflow\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 "
File "
File "
File "
File "
File "
File "
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-packagestensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packagestensorflow\python\pywrap_tensorflow_internal.py", line 17, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packagestensorflow\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\mlagentstrainers__init__.py", line 5, in
from .models import *
File "c:users\MyName\downloads\ml-agents-master\ml-agents-master\ml-agents\mlagentstrainers\models.py", line 4, in
import tensorflow as tf
File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packagestensorflow__init__.py", line 24, in
from tensorflow.python import * # pylint: disable=redefined-builtin
File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packagestensorflow\python__init__.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packagestensorflow\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-packagestensorflow\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 "
File "
File "
File "
File "
File "
File "
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-packagestensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packagestensorflow\python\pywrap_tensorflow_internal.py", line 17, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\MyName.conda\envs\ml-agents\lib\site-packagestensorflow\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."
I think you haven't installed the tensorflow correctly. Following the tensorflow guide and install 1.7.1 would be what you want.
We are closing this issue due to inactivity. Feel free to reopen it if you鈥檇 like to continue the discussion.