我正在尝试建立图像分类器,并想要导入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时,错误消息的数量增加了。 其中大多数是警告。
我该如何解决?