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

has no attribute 'EfficientNetB3' #127

Open
Arash-HR opened this issue Aug 26, 2020 · 13 comments
Open

has no attribute 'EfficientNetB3' #127

Arash-HR opened this issue Aug 26, 2020 · 13 comments

Comments

@Arash-HR
Copy link

Arash-HR commented Aug 26, 2020

Hi
when run demo.py , get this error ;

File "demo.py", line 92, in main
    model = get_model(cfg)
  File "/home/arash/Desktop/age-gender-estimation/src/factory.py", line 8, in get_model
    base_model = getattr(applications, cfg.model.model_name)(
AttributeError: module 'tensorflow.keras.applications' has no attribute 'EfficientNetB3'

I was worked with this repo without any problem before recent commits , but now ...
There is someone to help me ?

@Bloodrammer
Copy link

Make sure you have the latest tensorflow version installed, which is 2.3.0

@Arash-HR
Copy link
Author

Arash-HR commented Sep 2, 2020

@Bloodrammer

I have installed the latest version of Tensorflow

>>> import tensorflow as tf
>>> print(tf.__version__)
2.3.0

@yu4u
Copy link
Owner

yu4u commented Sep 2, 2020

How about this? The different version of Python might be used in running demo.

>>> import tensorflow as tf
>>> print(tf.__version__)
2.3.0
>>> tf.keras.applications.__dict__.keys()
dict_keys(['__name__', '__doc__', '__package__', '__loader__', '__spec__', '__path__', '__file__', '__cached__', '__builtins__', '_sys', 'densenet', 'efficientnet', 'imagenet_utils', 'inception_resnet_v2', 'inception_v3', 'mobilenet', 'mobilenet_v2', 'nasnet', 'resnet', 'resnet50', 'resnet_v2', 'vgg16', 'vgg19', 'xception', 'DenseNet121', 'DenseNet169', 'DenseNet201', 'EfficientNetB0', 'EfficientNetB1', 'EfficientNetB2', 'EfficientNetB3', 'EfficientNetB4', 'EfficientNetB5', 'EfficientNetB6', 'EfficientNetB7', 'InceptionResNetV2', 'InceptionV3', 'MobileNet', 'MobileNetV2', 'NASNetLarge', 'NASNetMobile', 'ResNet101', 'ResNet152', 'ResNet50', 'ResNet101V2', 'ResNet152V2', 'ResNet50V2', 'VGG16', 'VGG19', 'Xception'])

@Arash-HR
Copy link
Author

Arash-HR commented Sep 2, 2020

@yu4u

>>> import tensorflow as tf
>>> print(tf.__version__)
2.3.0
>>> tf.keras.applications.__dict__.keys()
dict_keys(['__name__', '__doc__', '__package__', '__loader__', '__spec__', '__path__', '__file__', '__cached__', '__builtins__', '_sys', 'densenet', 'efficientnet', 'imagenet_utils', 'inception_resnet_v2', 'inception_v3', 'mobilenet', 'mobilenet_v2', 'nasnet', 'resnet', 'resnet50', 'resnet_v2', 'vgg16', 'vgg19', 'xception', 'DenseNet121', 'DenseNet169', 'DenseNet201', 'EfficientNetB0', 'EfficientNetB1', 'EfficientNetB2', 'EfficientNetB3', 'EfficientNetB4', 'EfficientNetB5', 'EfficientNetB6', 'EfficientNetB7', 'InceptionResNetV2', 'InceptionV3', 'MobileNet', 'MobileNetV2', 'NASNetLarge', 'NASNetMobile', 'ResNet101', 'ResNet152', 'ResNet50', 'ResNet101V2', 'ResNet152V2', 'ResNet50V2', 'VGG16', 'VGG19', 'Xception'])

@yu4u
Copy link
Owner

yu4u commented Sep 3, 2020

It's strange.
EfficientNetB3 does exist.

@gmt710
Copy link

gmt710 commented Dec 4, 2020

@yu4u , Hello, EfficientNetB3 ' s input size is 300 * 300, but the age and gender estimate model is 224 * 224.
How can we get the EfficientNetB3 pretrained model?

image

@yu4u
Copy link
Owner

yu4u commented Dec 4, 2020

@gmt710
Copy link

gmt710 commented Dec 4, 2020

But another error will occur.

ValueError: You are trying to load a weight file containing 211 layers into a model with 210 layers.

@yu4u
Copy link
Owner

yu4u commented Dec 4, 2020

How can I reproduce the error?

@gmt710
Copy link

gmt710 commented Dec 4, 2020

My enviroment:

cuda9.0
tensorflow == v1.12.0
keras == 2.2.4

I add EfficientNet to keras.applications.
I run demo.py and get the error.

ValueError: You are trying to load a weight file containing 211 layers into a model with 210 layers.

@yu4u
Copy link
Owner

yu4u commented Dec 4, 2020

Please use tensorflow>=2.3.0

@gmt710
Copy link

gmt710 commented Dec 4, 2020

Sorry, My cuda version doesn‘t support it.
It's not easy for me to change the servers' env.

@gmt710
Copy link

gmt710 commented Dec 11, 2020

cuda10.1 tensorflow-v2.3.0 is ok.

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

4 participants