Reputation: 7267
I want to load pre-trained ResNet50v2 model in Keras. I tried
keras.applications.resnet_v2.ResNet50V2()
This gave an error
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: module 'keras.applications' has no attribute 'resnet_v2'
On searching that error, this answer suggested to use keras_applications
package. So I tried
keras_applications.resnet_v2.ResNet50V2()
This gives the error
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/nagabhushan/.local/lib/python3.6/site-packages/keras_applications/resnet_common.py", line 495, in ResNet50V2
**kwargs)
File "/home/nagabhushan/.local/lib/python3.6/site-packages/keras_applications/resnet_common.py", line 348, in ResNet
data_format=backend.image_data_format(),
AttributeError: 'NoneType' object has no attribute 'image_data_format'
On searching that error, this answer suggests to use keras.applications
package. I'm confused. How can I load ResNetv2 model?
Note: I was able to load ResNet50. Only ResNet50v2 is giving problems
from keras.applications.resnet50 import ResNet50
Upvotes: 5
Views: 4146
Reputation: 1803
import keras
keras.applications.resnet_v2.ResNet50V2()
Upvotes: 2