heuritech / convnets-keras

MIT License
594 stars 185 forks source link

Error when using Convnetkeras with Anaconda and Python 2.7 #12

Open MandarKulkarni40 opened 7 years ago

MandarKulkarni40 commented 7 years ago

Hi I have setup the Convnetkeras as mentioned in the webpage. But, when i try to import convnets from convnetkeras, it gives an error. It says that the module does not exist.

Can you please help me to resolve the error.

EloiZ commented 7 years ago

Hi, Can you please send the precise error message you get? Are you sure that you ran the setup.py in convnets-keras to install the package?

MandarKulkarni40 commented 7 years ago

i type following import of console

from convnetskeras.convnets import preprocess_image_batch

i get following error

Using Theano backend. It seems the kernel died unexpectedly. Use 'Restart kernel' to continue using this console. It seems the kernel died unexpectedly. Use 'Restart kernel' to continue using this console. It seems the kernel died unexpectedly. Use 'Restart kernel' to continue using this console.

When I tested it further, I see that I am able to import convnetkeras individually. But i see the following error with these lines of code

import convnetskeras im = convnetskeras.convnets.preprocess_image_batch(['examples/dog.jpg'],img_size=(256,256), crop_size=(224,224), color_mode="bgr")

Error:

File "C:\Users\1047402\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 74, in execfile exec(compile(scripttext, filename, 'exec'), glob, loc)

File "C:/Mandar/work/Python/pretrained_CNN/convnets-keras-master/covnet_try.py", line 20, in im = convnetskeras.convnets.preprocess_image_batch(['examples/dog.jpg'],img_size=(256,256), crop_size=(224,224), color_mode="bgr")

AttributeError: 'module' object has no attribute 'convnets'

I guess there is a issue with the particular model in convnetkeras.

Please help to debug.