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

EfficientNetL2 tf.keras error #121

Open
kurnianggoro opened this issue Jun 29, 2020 · 3 comments
Open

EfficientNetL2 tf.keras error #121

kurnianggoro opened this issue Jun 29, 2020 · 3 comments

Comments

@kurnianggoro
Copy link

Hello,

it seems that the efficientnetL2 is having problem
i tried to load model but i got an error for both imagenet and noisy student checkpoint

the error message is something like this (i deleted some of them for simplicity)

/usr/local/lib/python3.6/dist-packages/efficientnet/model.py in EfficientNet(width_coefficient, depth_coefficient, default_resolution, dropout_rate, drop_connect_rate, depth_divisor, blocks_args, model_name, include_top, weights, input_tensor, input_shape, pooling, classes, **kwargs)
    386                                   activation=activation,
    387                                   drop_rate=drop_rate,
--> 388                                   prefix=block_prefix)
    389                 block_num += 1
    390 

/usr/local/lib/python3.6/dist-packages/efficientnet/model.py in mb_conv_block(inputs, block_args, activation, drop_rate, prefix)
    240             x = Dropout(drop_rate,
    241                         noise_shape=(None, 1, 1, 1),
--> 242                         name=prefix + 'drop')(x)
    243         x = layers.add([x, inputs], name=prefix + 'add')
    244 

'ValueError: rate must be a scalar tensor or a float in the range [0, 1), got 1'

You can check the code here
https://colab.research.google.com/drive/1IyKFQut8q23jKeGOgXzSmn4e2qKGTyzl

I dont really understand why this is happened since the code for this model is basically same with the other versions but using different parameters in width_coefficient,depth_coefficient,default_resolution,dropout_rate

@kurnianggoro
Copy link
Author

Maybe related to this one #117

@kd2718
Copy link

kd2718 commented Jul 8, 2020

So I did some digging, and it looks like this is not ready for use yet. First of all, there is an error when calculating the drop_rate here. The default value of drop_connect_rate will return a drop_rate of 1. You can get around this by calling efficientnetL2 with the parameter drop_connect_rate=0.05. However, there will be new errors when the weights for L2 are downloaded.

In the weights file, there is no key for efficientnet-l2. Checking the reference to the weights download release, you can see that there is indeed no weights for L2.

Basically, EfficientNetL2 does not seem to be implemented, nor are there weights for it yet.

@ucb-pb
Copy link

ucb-pb commented Apr 13, 2021

What's the error involving drop_rate? Has it been fixed?

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