python modulenotfounderror_python - 如何解决:“ ModuleNotFoundError:没有名为'tensorflow.contrib'的模块” - 堆栈内存溢出...

我正在尝试建立图像分类器,并想要导入tflearn。

# Importing the required libraries

import tflearn

from tflearn.layers.conv import conv_2d, max_pool_2d

from tflearn.layers.core import input_data, dropout, fully_connected

from tflearn.layers.estimator import regression

import tensorflow as tf

但是,由于以下错误消息,我无法这样做。

File "imgclassification.py", line 97, in

import tflearn

File "/usr/local/lib/python3.7/site-packages/tflearn/__init__.py", line 4, in

from . import config

File "/usr/local/lib/python3.7/site-packages/tflearn/config.py", line 5, in

from .variables import variable

File "/usr/local/lib/python3.7/site-packages/tflearn/variables.py", line 7, in

from tensorflow.contrib.framework.python.ops import add_arg_scope as contrib_add_arg_scope

ModuleNotFoundError: No module named 'tensorflow.contrib'

显然,在最新版本的TensorFlow中不推荐使用tensorflow.contrib。

当我卸载TensorFlow 2.0和安装TensorFlow 1.14时,错误消息的数量增加了。 其中大多数是警告。

我该如何解决?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值