Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Error when trying to run mlagents-learn

Discussion in 'ML-Agents' started by unity_nxlAMDu4qpgJxw, May 13, 2020.

  1. unity_nxlAMDu4qpgJxw

    unity_nxlAMDu4qpgJxw

    Joined:
    May 5, 2020
    Posts:
    3
    Im kinda new to Unity so I may have done something wrong. But I did follow the installation guide from start to finish. My guess is I did something wrong in the part python package install, although I did follow that aswell.
    However when I try to run the mlagents-learn command
    mlagents-learn config/ppo/3DBall.yaml --run-id=first3DBallRun
    in cmd I get the following error.

    Traceback (most recent call last):
    File "c:\users\emiln\appdata\local\programs\python\python37\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
    File "c:\users\emiln\appdata\local\programs\python\python37\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
    File "c:\users\emiln\appdata\local\programs\python\python37\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
    File "c:\users\emiln\appdata\local\programs\python\python37\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
    File "c:\users\emiln\appdata\local\programs\python\python37\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
    ImportError: DLL load failed: Cannot find the assigned module.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "C:\Users\EmilN\AppData\Local\Programs\Python\Python37\Scripts\mlagents-learn-script.py", line 11, in <module>
    load_entry_point('mlagents', 'console_scripts', 'mlagents-learn')()
    File "c:\users\emiln\appdata\local\programs\python\python37\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\emiln\appdata\local\programs\python\python37\lib\site-packages\pkg_resources\__init__.py", line 2852, in load_entry_point
    return ep.load()
    File "c:\users\emiln\appdata\local\programs\python\python37\lib\site-packages\pkg_resources\__init__.py", line 2443, in load
    return self.resolve()
    File "c:\users\emiln\appdata\local\programs\python\python37\lib\site-packages\pkg_resources\__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
    File "d:\unity stuff\ml-agents-master\ml-agents-master\ml-agents\mlagents\trainers\learn.py", line 13, in <module>
    from mlagents import tf_utils
    File "d:\unity stuff\ml-agents-master\ml-agents-master\ml-agents\mlagents\tf_utils\__init__.py", line 1, in <module>
    from mlagents.tf_utils.tf import tf as tf # noqa
    File "d:\unity stuff\ml-agents-master\ml-agents-master\ml-agents\mlagents\tf_utils\tf.py", line 3, in <module>
    import tensorflow as tf # noqa I201
    File "c:\users\emiln\appdata\local\programs\python\python37\lib\site-packages\tensorflow\__init__.py", line 101, in <module>
    from tensorflow_core import *
    File "c:\users\emiln\appdata\local\programs\python\python37\lib\site-packages\tensorflow_core\__init__.py", line 40, in <module>
    from tensorflow.python.tools import module_util as _module_util
    File "c:\users\emiln\appdata\local\programs\python\python37\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
    module = self._load()
    File "c:\users\emiln\appdata\local\programs\python\python37\lib\site-packages\tensorflow\__init__.py", line 44, in _load
    module = _importlib.import_module(self.__name__)
    File "c:\users\emiln\appdata\local\programs\python\python37\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
    File "c:\users\emiln\appdata\local\programs\python\python37\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
    File "c:\users\emiln\appdata\local\programs\python\python37\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
    ImportError: Traceback (most recent call last):
    File "c:\users\emiln\appdata\local\programs\python\python37\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
    File "c:\users\emiln\appdata\local\programs\python\python37\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
    File "c:\users\emiln\appdata\local\programs\python\python37\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
    File "c:\users\emiln\appdata\local\programs\python\python37\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
    File "c:\users\emiln\appdata\local\programs\python\python37\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
    ImportError: DLL load failed: Cannot find the assigned module.

    Given the error messages I am assuming the issue is with Python. Quick notes aswell, im not in a virtual environment, not sure if this matters. I just wanted to do some simple tests for a thesis project. Also is there a way to pull graphs out from the training session?
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,768
    I'll flag this for the team to investigate. Which version of ML Agents, C#, and Python are you using?
     
  3. unity_nxlAMDu4qpgJxw

    unity_nxlAMDu4qpgJxw

    Joined:
    May 5, 2020
    Posts:
    3
    3.7 for Python.
    ML agents should be April 30, 2020 release. Atleast one of the latests ones. Could be master release.
    C# is whatever is standard in the Unity version 2019.3.12f1.
     
  4. celion_unity

    celion_unity

    Unity Technologies

    Joined:
    Jun 12, 2019
    Posts:
    289
  5. unity_nxlAMDu4qpgJxw

    unity_nxlAMDu4qpgJxw

    Joined:
    May 5, 2020
    Posts:
    3
    Seems to be working now for the most part. Atleast the training runs, although it does pop up some error looking messages before the training starts.


    2020-06-02 11:23:03.933799: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1555] Found device 0 with properties:
    pciBusID: 0000:01:00.0 name: GeForce GTX 970 computeCapability: 5.2
    coreClock: 1.253GHz coreCount: 13 deviceMemorySize: 4.00GiB deviceMemoryBandwidth: 208.91GiB/s
    2020-06-02 11:23:03.948309: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
    2020-06-02 11:23:03.958275: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cublas64_10.dll'; dlerror: cublas64_10.dll not found
    2020-06-02 11:23:03.968199: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cufft64_10.dll'; dlerror: cufft64_10.dll not found
    2020-06-02 11:23:03.978077: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'curand64_10.dll'; dlerror: curand64_10.dll not found
    2020-06-02 11:23:03.987569: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cusolver64_10.dll'; dlerror: cusolver64_10.dll not found
    2020-06-02 11:23:03.997727: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cusparse64_10.dll'; dlerror: cusparse64_10.dll not found
    2020-06-02 11:23:04.008094: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudnn64_7.dll'; dlerror: cudnn64_7.dll not found
    2020-06-02 11:23:04.016352: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1592] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
    Skipping registering GPU devices...

    Not sure if these are an issue or if I can just ignore them. Alas atleast the training runs.
     
  6. MrWetsnow

    MrWetsnow

    Joined:
    Jan 5, 2020
    Posts:
    60