heuritech / convnets-keras

MIT License
594 stars 185 forks source link

preprocess_image_batch function error- TypeError: imread() got an unexpected keyword argument 'mode' #26

Closed ghost closed 7 years ago

ghost commented 7 years ago

I have installed your library and all other necessary dependencies in my local system. I have used your example image dog.jpg for initial testing. But when I tried this

from keras.optimizers import SGD
from convnetskeras.convnets import preprocess_image_batch, convnet

im = preprocess_image_batch(['/media/disk_1/CNN/keras/dog.jpg'],img_size=(256,256), crop_size=(227,227), color_mode="rgb")

when prepossessing the image using prepocess_image_batch() this code gives out this error

TypeError: imread() got an unexpected keyword argument 'mode'

ghost commented 7 years ago

I found what caused the error. Its because of an old version of scipy

pip show scipy
0.13.3

it seems mode was added after 0.17 version and you can solve the problem by upgrading to latest version

pip install --upgrade scipy