"Failed to load native TensorFlow runtime. "用rocm导入tensorflow时出错。

问题描述 投票:0回答:1

我对用pycharm学习tensorflow感兴趣,想用amd系统(r5 3600x,rx 5700xt)做几个项目。在意识到只有安装了linux系统,我才能用我的gpu实现这个功能后,我安装了ubuntu 18.04与Windows 10双启动,因为它看起来是最支持rocm的。我按照这里的教程来做,只是我没有做虚拟环境。https:/www.videogames.aiInstall-ROCM-Machine-Learning-AMD-GPU当输入 sudo apt install rocm-libs miopen-hip cxlactivitylogger 它说找不到cxlactivitylogger包,作者在评论中说他会研究一下,但没有必要安装tensorflow,所以我没有理会。然后我打开了pycharm,tensorflow包检测不到,所以我又在pycharm中安装了tensorflow-rocm,以确定一下,但每当我试图在pycharm或终端中导入它时,它都会给我这个错误。

    Traceback (most recent call last):
  File "/home/waiai/PycharmProjects/app/venv/lib/python3.6/site-packages/tensorflow_core/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/waiai/PycharmProjects/app/venv/lib/python3.6/site-packages/tensorflow_core/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/waiai/PycharmProjects/app/venv/lib/python3.6/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 "/usr/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: librccl.so.1: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/waiai/PycharmProjects/app/main.py", line 1, in <module>
    import tensorflow
  File "/home/waiai/PycharmProjects/app/venv/lib/python3.6/site-packages/tensorflow/__init__.py", line 101, in <module>
    from tensorflow_core import *
  File "/home/waiai/PycharmProjects/app/venv/lib/python3.6/site-packages/tensorflow_core/__init__.py", line 40, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "/home/waiai/PycharmProjects/app/venv/lib/python3.6/site-packages/tensorflow/__init__.py", line 50, in __getattr__
    module = self._load()
  File "/home/waiai/PycharmProjects/app/venv/lib/python3.6/site-packages/tensorflow/__init__.py", line 44, in _load
    module = _importlib.import_module(self.__name__)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/waiai/PycharmProjects/app/venv/lib/python3.6/site-packages/tensorflow_core/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/home/waiai/PycharmProjects/app/venv/lib/python3.6/site-packages/tensorflow_core/python/pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/home/waiai/PycharmProjects/app/venv/lib/python3.6/site-packages/tensorflow_core/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/waiai/PycharmProjects/app/venv/lib/python3.6/site-packages/tensorflow_core/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/waiai/PycharmProjects/app/venv/lib/python3.6/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 "/usr/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: librccl.so.1: cannot open shared object file: No such file or directory


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.

我对linux毫无经验,所以这一切都让我很头疼,在这之前我试着安装了pytorch,但我得到了类似的错误,所以我决定试试tensorflow。如果有谁能费心牵着我的手走完这段路,那将是非常感激的,先谢谢了。

python tensorflow pycharm
1个回答
0
投票

固定,我安装了rccl与

sudo apt install rccl
© www.soinside.com 2019 - 2024. All rights reserved.