![](/img/trans.png)
[英]Error when importing Tensorflow - Failed to load the native TensorFlow runtime
[英]“Failed to load the native TensorFlow runtime.” error when importing tensorflow with rocm
我有興趣學習 tensorflow 和 pycharm,用於一些帶有 amd 系統(r5 3600x,rx 5700xt)的項目。 After realizing I was only going to get this to work with my gpu if I installed linux, I installed ubuntu 18.04 to dualboot with Windows 10, since it looked like the most supported for rocm. 我按照這里的教程進行操作,只是我沒有制作虛擬環境。 https://www.videogames.ai/Install-ROCM-Machine-Learning-AMD-GPU當輸入sudo apt install rocm-libs miopen-hip cxlactivitylogger
時,它說它找不到 package cxlactivitylogger,在作者的評論中,說他會研究它,但沒有必要安裝tensorflow,所以我忽略了它。 I then opened up pycharm, the tensorflow package wouldn't detect so I installed tensorflow-rocm again in pycharm just to make sure, but it gives me this error whenever I try to import it in pycharm or in the terminal.
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,但我遇到了類似的錯誤,所以我決定嘗試 Z2C39BC19B761AC36DC046245D1D4。 如果有人能打擾我的手,將不勝感激,在此先感謝。
固定,我安裝了 rccl
sudo apt install rccl
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.