【问题标题】:tensorflow issue in Python 3.9Python 3.9 中的张量流问题
【发布时间】:2021-02-01 14:39:49
【问题描述】:

我正在使用以下软件包,但不知何故我收到以下错误:

import numpy
import tflearn
import tensorflow
import random

错误:

2020-10-18 23:50:57.727315: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll
 not found
2020-10-18 23:50:57.729741: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
  File "main.py", line 6, in <module>
    import tflearn
  File "C:\Users\sayan\anaconda3\envs\chatbot\lib\site-packages\tflearn\__init__.py", line 4, in <module>
    from . import config
  File "C:\Users\sayan\anaconda3\envs\chatbot\lib\site-packages\tflearn\config.py", line 5, in <module>
    from .variables import variable
  File "C:\Users\sayan\anaconda3\envs\chatbot\lib\site-packages\tflearn\variables.py", line 7, in <module>
    from tensorflow.contrib.framework.python.ops import add_arg_scope as contrib_add_arg_scope
ModuleNotFoundError: No module named 'tensorflow.contrib'

【问题讨论】:

    标签: python tensorflow


    【解决方案1】:

    主要错误是由于缺少模块tensorflow.contrib。我相信tflearn 可能会将其作为依赖项。较新版本的 tensorflow (>2.0) 不包含 contrib 模块。

    您可以通过将tflearn 升级到最新版本来解决此问题。根据他们的文档,现在支持 TF2.0。 (Installation instructions here)

    除此之外您还有tensorflow提供的警告(W)和信息(I)。

    1. 警告指出它无法访问 cuda 文件以获得 GPU 支持。
    2. 信息表明,如果您不使用 GPU,则可以忽略该警告。

    您希望使用支持 GPU 的 tensorflow 吗?这可能需要安装 cuda 和其他依赖项。

    【讨论】:

      猜你喜欢
      • 2019-01-17
      • 1970-01-01
      • 2016-06-17
      • 2021-08-21
      • 2018-06-10
      • 2021-10-27
      • 2021-10-30
      • 1970-01-01
      相关资源
      最近更新 更多