PaddlePaddle / PARL

A high-performance distributed training framework for Reinforcement Learning
https://parl.readthedocs.io/
Apache License 2.0
3.25k stars 820 forks source link

[Bug Fix] Fix PARL import bug #1098

Closed nepeplwu closed 1 year ago

nepeplwu commented 1 year ago

Fixed the problem that the installed_framework was not correctly initialized due to the failure to import the deep learning framework

Python 3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 06:04:10) 
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import parl
Process Process-2:
Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/opt/conda/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/conda/lib/python3.8/site-packages/parl/utils/utils.py", line 111, in check
    import torch
  File "/opt/conda/lib/python3.8/site-packages/torch/__init__.py", line 198, in <module>
    _load_global_deps()
  File "/opt/conda/lib/python3.8/site-packages/torch/__init__.py", line 151, in _load_global_deps
    ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
  File "/opt/conda/lib/python3.8/ctypes/__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libopen-rte.so.40: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/conda/lib/python3.8/site-packages/parl/__init__.py", line 20, in <module>
    from parl.utils.utils import _HAS_FLUID, _HAS_TORCH, _HAS_PADDLE, _IS_WINDOWS
  File "/opt/conda/lib/python3.8/site-packages/parl/utils/__init__.py", line 16, in <module>
    from parl.utils.utils import *
  File "/opt/conda/lib/python3.8/site-packages/parl/utils/utils.py", line 137, in <module>
    check_installed_framework()
  File "/opt/conda/lib/python3.8/site-packages/parl/utils/utils.py", line 125, in check_installed_framework
    _HAS_FLUID = installed_framework['_HAS_FLUID']
  File "<string>", line 2, in __getitem__
  File "/opt/conda/lib/python3.8/multiprocessing/managers.py", line 850, in _callmethod
    raise convert_to_error(kind, result)
KeyError: '_HAS_FLUID'
>>>