Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import error for Keras pre trained models in monk #144

Open
Ayush6459 opened this issue Sep 14, 2021 · 2 comments
Open

Import error for Keras pre trained models in monk #144

Ayush6459 opened this issue Sep 14, 2021 · 2 comments

Comments

@Ayush6459
Copy link

hii , I am trying to use monk for Keras prototype for pre-trained image classification models like resent50 but the backend is giving me error like this :

ImportError Traceback (most recent call last)
in ()
----> 1 ptf.Default(dataset_path=["./dataset/train", "./dataset/val"], model_name="resnet50", freeze_base_network=True, num_epochs=5);

11 frames
/usr/local/lib/python3.7/dist-packages/monk/tf_keras_1/models/models.py in get_base_model(model_name, use_pretrained, num_classes, freeze_base_network, input_size)
62 from keras.applications import NASNetLarge as keras_model
63 elif(model_name == "resnet50"):
---> 64 from keras.applications import ResNet50 as keras_model
65 elif(model_name == "resnet101"):
66 from keras.applications import ResNet101 as keras_model

ImportError: cannot import name 'ResNet50' from 'keras.applications' (/usr/local/lib/python3.7/dist-packages/keras/applications/init.py)


NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

I am using monk in Colab , Please see the issue .

@ravikanur
Copy link

This is basically a version issue. In the current version keras has been included inside tensorflow. Hence while importing it should be imported as
from tensorflow.keras.applications import ResNet50

@Chaituvarma-109
Copy link

Having the same issue. How to solve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants