Issue
I was training a model for images using tensorflow and keras.
history = model.fit_generator(
train_data_gen,
steps_per_epoch=8000, #batch_size
epochs=epochs,
validation_data=val_data_gen,
validation_steps=800 # batch_size
)
I got this error:
ImportError: Could not import PIL.Image. The use of `load_img` requires PIL.
Pillow is already installed in my conda
environment.
How can I resolve this?
Solution
You have to update the environment as below if you are not specific to the versions
pip install --upgrade tensorflow keras numpy pandas sklearn pillow
But if you are specific to versions then
pip install pillow
Note: If only install pillow then you need deactivate and reactivate the virtual environment.
Answered By - bsquare
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.