profile
viewpoint

Ask questionsModuleNotFoundError: No module named 'tensorflow.contrib'

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

convnet = input_data(shape=[None, IMG_SIZE, IMG_SIZE, 1], name='input')

convnet = conv_2d(convnet, 32, 2, activation='relu') convnet = max_pool_2d(convnet, 2)

convnet = conv_2d(convnet, 64, 2, activation='relu') convnet = max_pool_2d(convnet, 2)

convnet = fully_connected(convnet, 1024, activation='relu') convnet = dropout(convnet, 0.8)

convnet = fully_connected(convnet, 2, activation='softmax') convnet = regression(convnet, optimizer='adam', learning_rate=LR, loss='categorical_crossentropy', name='targets')

model = tflearn.DNN(convnet, tensorboard_dir='log')

I am facing below issue

ModuleNotFoundError Traceback (most recent call last) <ipython-input-6-8507f364adee> in <module> ----> 1 import tflearn 2 from tflearn.layers.conv import conv_2d, max_pool_2d 3 from tflearn.layers.core import input_data, dropout, fully_connected 4 from tflearn.layers.estimator import regression 5

~\Anaconda3\Lib\site-packages\tflearn_init_.py in <module> 2 3 # Config ----> 4 from . import config 5 from .config import is_training, get_training_mode, init_graph 6

~\Anaconda3\Lib\site-packages\tflearn\config.py in <module> 3 import tensorflow as tf 4 ----> 5 from .variables import variable 6 7 # -------------------

~\Anaconda3\Lib\site-packages\tflearn\variables.py in <module> 5 import tflearn 6 ----> 7 from tensorflow.contrib.framework.python.ops import add_arg_scope as contrib_add_arg_scope 8 from tensorflow.python.framework import ops 9 from tensorflow.python.ops import variable_scope

ModuleNotFoundError: No module named 'tensorflow.contrib'

tensorflow/tensorflow

Answer questions pandrey-fr

You are welcome! Don't forget to close the issue :)

useful!

Related questions

Error occurred when finalizing GeneratorDataset iterator hot 4
The flag 'log_dir' is defined twice. hot 3
AttributeError: module 'tensorflow' has no attribute 'set_random_seed' hot 3
Incorrect Error TypeError: padded_batch() missing 1 required positional argument: &#39;padded_shapes&#39; hot 3
tensorflow2.0 detected 'xla_gpu' , but 'gpu' expected hot 2
Using tensorflow gpu 2.1 with Cuda 10.2 hot 2
Restoring Keras model fails inside a distribution strategy scope hot 2
tf.strings.split bug hot 2
Cannot run tensorflow GPU 2.0 with cuda 9.2 hot 2
module 'tensorflow_core._api.v2.nn' has no attribute 'rnn_cell' hot 2
Lossy conversion from float32 to uint8. Range [0, 1]. Convert image to uint8 prior to saving to suppress this warning. hot 2
compiling c++ code with TFLite library gives error with cstring hot 2
Tensorflow 2.0 error when used via pyinstaller build - ImportError: cannot import name 'pywrap_tensorflow' from 'tensorflow_core.python' hot 2
TF2.0 AutoGraph issue hot 2
TypeError: Cannot interpret feed_dict key as Tensor: Tensor Tensor("Placeholder:0", shape=(7, 7, 3, 64), dtype=float32) is not an element of this graph. hot 2
Github User Rank List