Error: ModuleNotFoundError: No module named 'tensorflow.contrib' - python

I'm using Tensorflow 2.0 but getting error while executing train.py.
from tensorflow.contrib.memory_stats.python.ops.memory_stats_ops import BytesInUse
ModuleNotFoundError: No module named 'tensorflow.contrib'
can anyone please help me with finding tf.contrib module in tensorflow2.0

tensorflow.contrib is being removed in version 2.0, you therefore need version <= 1.14 to operate tflearn (by the way, this is a TFlearn issue, not a tensorflow one). (source)

Related

Problem after the installation of tensorflow 2.11.0 version

I have just upgraded tensorflow to the 2.11.0 version but I am having issues while importing packages.
In particular, while importing the 'compat' and the 'keras' modules I got the following errors:
import tensorflow.compat.v2 as tf
ModuleNotFoundError: No module named 'tensorflow.compat'
from tensorflow import keras
ImportError: cannot import name 'keras' from 'tensorflow' (unknown location)
What can be the reason of these import errors? I never had them before but I had to upgrade to the 2.11.0
I have tryied to unistall and re-install but I always get the same issue.
I need the 2.11.0 since otherwise I have issues with the 'build' method for optimizers in the tf.keras.optimizers module

Numpy issue module 'os' has no attribute 'add_dll_directory'

When importing Numpy Keras Tensorflow I recieve this error
File "c:/Users//AppData/Local/Programs/Python/Python36/lib/site-packages/numpy/__config__.py", line 12, in <module> os.add_dll_directory(extra_dll_dir) AttributeError: module 'os' has no attribute 'add_dll_directory'
I have tried uninstalling and re installing numpy keras and tensorflow but this issue still remains, please help.
I have tried running this in other environments such as Replit but it still doesnt work.

ImportError: cannot import name '__version__' from 'keras' (unknown location)

Facing this while working with jupyter notebook
Tensorflow and keras version -- 2.8.0
Please help me with this tried installing the previous version of keras and reinstalling as well but it didn't work.

ModuleNotFoundError: No module named 'tensorflow.python.eager'

I installed Tensorflow packages but it gives an error like this:
I also upgraded tensorflow version in case:

How can I fix AttributeError: module 'tensorflow' has no attribute 'ConfigProto'

I am new to deep learning and I get the following error when I try to run the command for image style transfer given in a tutorial I am using to learn.
python evaluate.py --checkpoint ./rain-princess.ckpt --in-path <path_to_input_file> --out-path ./output_image.jpg
I have scipy 1.1.0 installed. (downgraded to fix the issues AttributeError: module 'tensorflow' has no attribute 'imread').
I have Tensorflow installed. I have pillow installed.
Please note that I do not have the knowledge to edit any file, I am just copying the commands to see how it executes.
A screenshot of the error message
This could be because you are using tensorflow 2.0 (when installing tensorflow by default it installs 2.0 now). Seems like your evaluvate.py file is suited to execute with tensorflow 1.* as it searches for configproto that is absent in 2.0 So downgrade tensorflow by
pip install tensorflow==1.14

Categories