Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question ml-agents release 12 can't use numpy 1.19.3 for tensorflow 2.4.0

Discussion in 'ML-Agents' started by tarisetsuna, Dec 27, 2020.

  1. tarisetsuna

    tarisetsuna

    Joined:
    Dec 23, 2020
    Posts:
    6
    I install tensorflow2.4.0 , numpy1.19.3 to train using RTX3060ti on Anaconda3,but mlagents-envs 0.23.0 requires numpy1.14.1
    Am I unable to learn using the GPU?
    When the numpy version was 1.14.5, I got the following message

    (ml-agents) H:\unity\learn_robot_stand>mlagents-learn config/learn_robot.yaml --run-id=robot_52
    Traceback (most recent call last):
    File "H:\Anaconda3\envs\ml-agents\Scripts\mlagents-learn-script.py", line 33, in <module>
    sys.exit(load_entry_point('mlagents', 'console_scripts', 'mlagents-learn')())
    File "H:\Anaconda3\envs\ml-agents\Scripts\mlagents-learn-script.py", line 25, in importlib_load_entry_point
    return next(matches).load()
    File "H:\Anaconda3\envs\ml-agents\lib\site-packages\importlib_metadata\__init__.py", line 96, in load
    module = import_module(match.group('module'))
    File "H:\Anaconda3\envs\ml-agents\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
    File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
    File "<frozen importlib._bootstrap>", line 983, in _find_and_load
    File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
    File "<frozen importlib._bootstrap_external>", line 728, in exec_module
    File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
    File "h:\unity\ml-agents-v12\ml-agents\mlagents\trainers\learn.py", line 2, in <module>
    from mlagents import torch_utils
    File "h:\unity\ml-agents-v12\ml-agents\mlagents\torch_utils\__init__.py", line 1, in <module>
    from mlagents.torch_utils.torch import torch as torch # noqa
    File "h:\unity\ml-agents-v12\ml-agents\mlagents\torch_utils\torch.py", line 29, in <module>
    import torch # noqa I201
    File "H:\Anaconda3\envs\ml-agents\lib\site-packages\torch\__init__.py", line 190, in <module>
    from torch._C import *
    ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'


    And when the numpy version was 1.19.2, I got the following


    (ml-agents) H:\unity\learn_robot_stand>mlagents-learn config/learn_robot.yaml --run-id=robot_52
    Traceback (most recent call last):
    File "H:\Anaconda3\envs\ml-agents\lib\site-packages\pkg_resources\__init__.py", line 567, in _build_master
    ws.require(__requires__)
    File "H:\Anaconda3\envs\ml-agents\lib\site-packages\pkg_resources\__init__.py", line 884, in require
    needed = self.resolve(parse_requirements(requirements))
    File "H:\Anaconda3\envs\ml-agents\lib\site-packages\pkg_resources\__init__.py", line 775, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
    pkg_resources.ContextualVersionConflict: (numpy 1.19.2 (h:\anaconda3\envs\ml-agents\lib\site-packages), Requirement.parse('numpy<1.19.0,>=1.14.1'), {'mlagents-envs'})

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "H:\Anaconda3\envs\ml-agents\Scripts\mlagents-learn-script.py", line 33, in <module>
    sys.exit(load_entry_point('mlagents', 'console_scripts', 'mlagents-learn')())
    File "H:\Anaconda3\envs\ml-agents\Scripts\mlagents-learn-script.py", line 25, in importlib_load_entry_point
    return next(matches).load()
    File "H:\Anaconda3\envs\ml-agents\lib\site-packages\importlib_metadata\__init__.py", line 96, in load
    module = import_module(match.group('module'))
    File "H:\Anaconda3\envs\ml-agents\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
    File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
    File "<frozen importlib._bootstrap>", line 983, in _find_and_load
    File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
    File "<frozen importlib._bootstrap_external>", line 728, in exec_module
    File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
    File "h:\unity\ml-agents-v12\ml-agents\mlagents\trainers\learn.py", line 2, in <module>
    from mlagents import torch_utils
    File "h:\unity\ml-agents-v12\ml-agents\mlagents\torch_utils\__init__.py", line 1, in <module>
    from mlagents.torch_utils.torch import torch as torch # noqa
    File "h:\unity\ml-agents-v12\ml-agents\mlagents\torch_utils\torch.py", line 4, in <module>
    import pkg_resources
    File "H:\Anaconda3\envs\ml-agents\lib\site-packages\pkg_resources\__init__.py", line 3238, in <module>
    @_call_aside
    File "H:\Anaconda3\envs\ml-agents\lib\site-packages\pkg_resources\__init__.py", line 3222, in _call_aside
    f(*args, **kwargs)
    File "H:\Anaconda3\envs\ml-agents\lib\site-packages\pkg_resources\__init__.py", line 3251, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
    File "H:\Anaconda3\envs\ml-agents\lib\site-packages\pkg_resources\__init__.py", line 569, in _build_master
    return cls._build_from_requirements(__requires__)
    File "H:\Anaconda3\envs\ml-agents\lib\site-packages\pkg_resources\__init__.py", line 582, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
    File "H:\Anaconda3\envs\ml-agents\lib\site-packages\pkg_resources\__init__.py", line 770, in resolve
    raise DistributionNotFound(req, requirers)
    pkg_resources.DistributionNotFound: The 'wheel>=0.26; python_version >= "3"' distribution was not found and is required by tensorboard


    What should I do?
    I use a translation because my English is not good enough.
    So I may not be able to explain well.
     
  2. ratdox

    ratdox

    Joined:
    Dec 17, 2020
    Posts:
    12
    try numpy 1.18.5, also what version of python are you running?
     
  3. tarisetsuna

    tarisetsuna

    Joined:
    Dec 23, 2020
    Posts:
    6
    I installed numpy 1.18.5 and it worked fine, recognizing GPU.
    thank you very much.
    my python version is 3.8.5