pywrap_tensorflow_internal.py为空文件



在openSUSE Leap 15.2上安装Python 3.8.5下的tensorflow 2.4.0,使用pip进入最近创建的虚拟环境。我的代码执行import tensorflow as tf",它最终执行

try:
  from tensorflow.python._pywrap_tensorflow_internal import *

错误提示"非法指示"。我发现两个问题:

  1. pywrap_tensorflow_internal.py为空文件;
  2. 没有文件_pywrap_tensorflow_internal.so.

我尝试将python降级到3.6。X和重新安装所有东西。由于另一个兼容性问题,此操作失败。有什么想法去哪里看或者下一步要尝试什么吗?


转储:

(karoo) (sage-sh) rllozes@S300Think:kstaats-karoo_gp-8e1af80$ python3 -X dev karoo_gp.py
Fatal Python error: Illegal instruction
Current thread 0x00007fcb4249f740 (most recent call first):
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 1101 in create_module
  File "<frozen importlib._bootstrap>", line 556 in module_from_spec
  File "<frozen importlib._bootstrap>", line 657 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 975 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 991 in _find_and_load
  File "/home/rllozes/Research/SR/karoo/lib/python3.8/site-packages/tensorflow/python/pywrap_tensorflow.py", line 64 in <module>
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 783 in exec_module
  File "<frozen importlib._bootstrap>", line 671 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 975 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 991 in _find_and_load
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1042 in _handle_fromlist
  File "/home/rllozes/Research/SR/karoo/lib/python3.8/site-packages/tensorflow/python/__init__.py", line 39 in <module>
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 783 in exec_module
  File "<frozen importlib._bootstrap>", line 671 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 975 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 991 in _find_and_load
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 961 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 991 in _find_and_load
  File "/home/rllozes/Research/SR/karoo/lib/python3.8/site-packages/tensorflow/__init__.py", line 41 in <module>
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 783 in exec_module
  File "<frozen importlib._bootstrap>", line 671 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 975 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 991 in _find_and_load
  File "modules/karoo_gp_base_class.py", line 35 in <module>
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 783 in exec_module
  File "<frozen importlib._bootstrap>", line 671 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 975 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 991 in _find_and_load
  File "karoo_gp.py", line 52 in <module>
Illegal instruction (core dumped)
(karoo) (sage-sh) rllozes@S300Think:kstaats-karoo_gp-8e1af80$ 

我发现英特尔优化Tensorflow在我的机器上工作。请按照说明操作。

注意:Pywrap_tensorflow_internal.py仍然为空,但没有错误发生。

相关内容

  • 没有找到相关文章

最新更新