ModuleNotFoundError: No module named 'tensorflow.contrib' Error

Issue

I am getting such an error in the keras codes ,wrote in pycharm.Tried the solutions on the internet but I couldn’t find a solution. Do you have any suggestions?

Error Image

Pip List

Solution

Please install the tensorflow and pillow using pip install tensorflow and pip install pillow then do a little changes as below while importing libraries to fix this error:

import numpy as np
from PIL import Image

from tensorflow import keras
from tensorflow.keras.applications import resnet50
from tensorflow.keras.preprocessing import image

Note: Please mention the error code in your question not in the form of a screenshot which will be easy to replicate the issue.

Answered By – TFer2

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published