你如何克服tensorflow-gpu的导入错误?

huangapple go评论78阅读模式
英文:

How could I overcome tensorflow-gpu import error?

问题

我是新的tensorflow编程。我们的工作站上有RTX2080 TI GPU。 安装了Win 10 64位操作系统。我正在使用Pycharm Community Edition 3.1编辑器。

我从网络上进行了研究(也从类似问题中进行了研究),并设置了以下版本:

Cuda 10.00
Cudnn v7.6.2.24
Python 3.6
Tensorflow-gpu 1.14.0

不幸的是,当我运行以下命令时:

import tensorflow as tf

Pycharm在python控制台中出现以下错误:

traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.1\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "C:/Users/5G/Desktop/OFDM_DNN-master/OFDM_DNN-master/DNN_Detection/OFDM_ChannelEstimation_DeepLearning_QAM_random_pilot.py", line 5, in <module>
    import tensorflow as tf
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "C:\UsersG\AppData\Roaming\Python\Python36\site-packages\tensorflow\__init__.py", line 28, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "C:\UsersG\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\__init__.py", line 52, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "C:\UsersG\AppData\Roaming\Python\Python36\site-packages\tensorflow\core\framework\graph_pb2.py", line 7, in <module>
    from google.protobuf import descriptor as _descriptor
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = this._system_import(name, *args, **kwargs)
  File "C:\UsersG\AppData\Roaming\Python\Python36\site-packages\google\protobuf\descriptor.py", line 47, in <module>
    from google.protobuf.pyext import _message
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = this._system_import(name, *args, **kwargs)
ImportError: DLL load failed: Belirtilen yordam bulunamadı.

我该如何克服这些错误?Python,Cuda,cuDNN,tensorflow-gpu的哪些版本是兼容的?

请给我一些建议吗?

英文:

I'm new tensorflow programming. We have RTX2080 TI GPU in the workstation.
Win 10 64 bit OS installed on it. I'm using Pycharm Community Edition 3.1 edıtor

I researched from the net(also from this similar questions) and I set up following versions below:

Cuda 10.00
Cudnn v7.6.2.24
Python 3.6
Tensorflow-gpu 1.14.0

Unfortunately when I run this command:

import tensorflow as tf

Pycharm gave this error into the python console:

 traceback (most recent call last):
  File &quot;&lt;input&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_umd.py&quot;, line 197, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File &quot;C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.1\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py&quot;, line 18, in execfile
    exec(compile(contents+&quot;\n&quot;, file, &#39;exec&#39;), glob, loc)
  File &quot;C:/Users/5G/Desktop/OFDM_DNN-master/OFDM_DNN-master/DNN_Detection/OFDM_ChannelEstimation_DeepLearning_QAM_random_pilot.py&quot;, line 5, in &lt;module&gt;
    import tensorflow as tf
  File &quot;C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py&quot;, line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File &quot;C:\UsersG\AppData\Roaming\Python\Python36\site-packages\tensorflow\__init__.py&quot;, line 28, in &lt;module&gt;
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File &quot;C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py&quot;, line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File &quot;C:\UsersG\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\__init__.py&quot;, line 52, in &lt;module&gt;
    from tensorflow.core.framework.graph_pb2 import *
  File &quot;C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py&quot;, line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File &quot;C:\UsersG\AppData\Roaming\Python\Python36\site-packages\tensorflow\core\framework\graph_pb2.py&quot;, line 7, in &lt;module&gt;
    from google.protobuf import descriptor as _descriptor
  File &quot;C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py&quot;, line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File &quot;C:\UsersG\AppData\Roaming\Python\Python36\site-packages\google\protobuf\descriptor.py&quot;, line 47, in &lt;module&gt;
    from google.protobuf.pyext import _message
  File &quot;C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py&quot;, line 21, in do_import
 
module = self._system_import(name, *args, **kwargs)
ImportError: DLL load failed: Belirtilen yordam bulunamadı.

How could I overcome these errors? Which versions of Phyton, Cuda,cuDNN, tensorflow-gpu are compatible with each other?

Would you give me advices please??

答案1

得分: 2

你是否在管理员模式下使用过命令提示符?

使用以下命令:

pip3 install --upgrade tensorflow-gpu
英文:

Have you used the command prompt in administrator mode?

Use the below command:

pip3 install --upgrade tensorflow-gpu

答案2

得分: 0

我解决了我的问题,只需:

设置tensorflow -gpu 1.5

在降级protobuf 3.6.0之后,就像这样:

pip install protobuf==3.6.0

它起作用了!!

英文:

I solved my problem just as:

Set up tensorflow -gpu 1.5

after downgrade protobuf 3.6.0 just as:

 pip install protobuf==3.6.0

İt worked!!

huangapple
  • 本文由 发表于 2020年1月4日 00:34:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/59582080.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定