Search Unity

  1. Unity 2019.4 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  3. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

mlagents-learn and Windows Server 2019 Errors

Discussion in 'ML-Agents' started by Clonus, Jun 24, 2020.

  1. Clonus

    Clonus

    Joined:
    May 26, 2015
    Posts:
    61
    Good day, I have been successful installing ML Agents on Windows 10 machines but now I am having a problem installing this on Windows Server 2019

    The install mimics my Win 10 versions with Python 3.6

    There are no installation errors and the Unity EXE runs fine on the server.

    When I call the mlagents-learn or tensorboard I get a slew of errors.

    This is from the mlagents-learn log.

    Any thoughts about how I can resolve this one? :)


    C:\mlagents>mlagents-learn config/EnemyAI.yaml --no-graphics --run-id=EnemyBehavior --env "c:\EnemyAI\EnemyAI"
    Traceback (most recent call last):
    File "c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
    File "c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
    File "c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
    File "c:\users\administrator\appdata\local\programs\python\python36\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
    File "c:\users\administrator\appdata\local\programs\python\python36\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
    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\administrator\appdata\local\programs\python\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
    File "c:\users\administrator\appdata\local\programs\python\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
    File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\Scripts\mlagents-learn.exe\__main__.py", line 4, in <module>
    File "c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\mlagents\trainers\learn.py", line 12, in <module>
    from mlagents import tf_utils
    File "c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\mlagents\tf_utils\__init__.py", line 1, in <module>
    from mlagents.tf_utils.tf import tf as tf # noqa
    File "c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\mlagents\tf_utils\tf.py", line 3, in <module>
    import tensorflow as tf # noqa I201
    File "c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
    from tensorflow.python.tools import module_util as _module_util
    File "c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\__init__.py", line 50, in <module>
    from tensorflow.python import pywrap_tensorflow
    File "c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 69, in <module>
    raise ImportError(msg)
    ImportError: Traceback (most recent call last):
    File "c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
    File "c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
    File "c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
    File "c:\users\administrator\appdata\local\programs\python\python36\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
    File "c:\users\administrator\appdata\local\programs\python\python36\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
    ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.


    Failed to load the native TensorFlow runtime.

    See https://www.tensorflow.org/install/errors

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

    Clonus

    Joined:
    May 26, 2015
    Posts:
    61
    So, I believe it's due to AVX instruction not supported on the Server CPU

    The server uses a set of Intel(R) Xeon(R) CPU X5650 @ 2.67GHz

    Too bad, it would have freed up my main machine... dang it! :(
     
  3. ervteng_unity

    ervteng_unity

    Unity Technologies

    Joined:
    Dec 6, 2018
    Posts:
    48
  4. Clonus

    Clonus

    Joined:
    May 26, 2015
    Posts:
    61
    Its the AVX instruction.. I think earlier versions were not compiled with AVX but newer ones are and i need 2.2.0 for MLAgents
     
  5. ervteng_unity

    ervteng_unity

    Unity Technologies

    Joined:
    Dec 6, 2018
    Posts:
    48
    ML-Agents is compatible with any TF >= 1.7, so if you want to use an older version you can do
    pip uninstall tensorflow
    and
    pip install tensorflow==<version>
     
  6. Clonus

    Clonus

    Joined:
    May 26, 2015
    Posts:
    61
    I tried but it said it required 2.2.0.. ??
     
  7. Clonus

    Clonus

    Joined:
    May 26, 2015
    Posts:
    61
    1.5 was the last version complied without AVX.. So it wont support.
     
  8. ervteng_unity

    ervteng_unity

    Unity Technologies

    Joined:
    Dec 6, 2018
    Posts:
    48
    If you really want to get it to work, there's always compiling tensorflow from scratch - won't be super straightforward, though.
     
  9. Clonus

    Clonus

    Joined:
    May 26, 2015
    Posts:
    61
    thanks, i have a few machines around here. thanks for the details @ervteng_unity
     
unityunity