我的系统中安装了tensorflow,但是当我运行导入tensorflow的代码时,出现以下错误

时间:2019-05-31 07:47:45

标签: tensorflow

我正在尝试训练一个使用tensorflow的程序。我下载了相同的版本(v = 1.6)。但是,出现以下错误。

我已经重新安装了tensorflow。 我什至安装了“ msvcp140.dll”,并将其放置在我安装了tensorflow的目录中。

     Traceback (most recent call last):
     File "/home/rashi/anaconda3/lib/python3.6/site- 
     packages/tensorflow/python/pywrap_tensorflow.py", line 58, in 
      <module>
     from tensorflow.python.pywrap_tensorflow_internal import *
     File "/home/rashi/anaconda3/lib/python3.6/site- 
     packages/tensorflow/python/pywrap_tensorflow_internal.py", line 
     28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
    File "/home/rashi/anaconda3/lib/python3.6/site- 
     packages/tensorflow/python/pywrap_tensorflow_internal.py", line 
    24, in swig_import_helper
   _mod = imp.load_module('_pywrap_tensorflow_internal', fp, 
   pathname, description)
   File "/home/rashi/anaconda3/lib/python3.6/imp.py", line 242, in 
   load_module
   return load_dynamic(name, filename, file)
   File "/home/rashi/anaconda3/lib/python3.6/imp.py", line 342, in 
   load_dynamic
   return _load(spec)
   ImportError: libcuda.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 "train.py", line 2, in <module>
   from model.ner_model import NERModel
   File "/home/rashi/Desktop/sequence_tagging- 
   master/model/ner_model.py", line 3, in <module>
   import tensorflow as tf
   File "/home/rashi/anaconda3/lib/python3.6/site- 
   packages/tensorflow/__init__.py", line 24, in <module>
   from tensorflow.python import pywrap_tensorflow  # pylint: 
   disable=unused-import
   File "/home/rashi/anaconda3/lib/python3.6/site- 
   packages/tensorflow/python/__init__.py", line 49, in <module>
   from tensorflow.python import pywrap_tensorflow
   File "/home/rashi/anaconda3/lib/python3.6/site- 
   packages/tensorflow/python/pywrap_tensorflow.py", line 74, in 
   <module>
  raise ImportError(msg)
  ImportError: Traceback (most recent call last):
  File "/home/rashi/anaconda3/lib/python3.6/site- 
  packages/tensorflow/python/pywrap_tensorflow.py", line 58, in 
  <module>
  from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/rashi/anaconda3/lib/python3.6/site- 
  packages/tensorflow/python/pywrap_tensorflow_internal.py", line 
  28, in <module>
 _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/rashi/anaconda3/lib/python3.6/site- 
 packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, 
 in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, 
 description)
 File "/home/rashi/anaconda3/lib/python3.6/imp.py", line 242, in 
 load_module
 return load_dynamic(name, filename, file)
 File "/home/rashi/anaconda3/lib/python3.6/imp.py", line 342, in 
 load_dynamic
 return _load(spec)
 ImportError: libcuda.so.1: cannot open shared object file: No such 
 file or directory


 Failed to load the native TensorFlow runtime. 

我需要消除此问题/错误。请帮我解决这个问题! PS:我正在使用Ubuntu 16.04 LTS,Python 3.6

0 个答案:

没有答案