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

What does FixedDropout layer does? #120

Open
xiankgx opened this issue Jun 22, 2020 · 5 comments
Open

What does FixedDropout layer does? #120

xiankgx opened this issue Jun 22, 2020 · 5 comments

Comments

@xiankgx
Copy link

xiankgx commented Jun 22, 2020

Dear author, your work on implementing EfficientNets for Keras is much appreciated.

I'm using your segmentation_models library which in turn uses this library. I trained a model in pure Keras (2.2.4) + TF v1.14.0. Using tensorflowjs_converter command line tool, I was able to convert the model to TF.js without any issues. However, when I try to do inference in TF.js, it is giving me two errors, swish activation function not implemented, and FixedDropout layer not implemented. I have implemented a custom swish layer in TF.js according to your code. However, I'm not too sure about FixedDropout.

According to your code, it says

"""Wrapper over custom dropout. Fix problem of ``None`` shape for tf.keras.
    It is not possible to define FixedDropout class as global object,
    because we do not have modules for inheritance at first time.
    Issue:
        https://github.com/tensorflow/tensorflow/issues/30946
    """

It seems it is just fixing some shape issue for tf.keras. Can I just subclass FixedDropout from Dropout in TensorFlow.js without overwriting the forward/call function?

@YifeiYang210
Copy link

@xiankgx Thanks for your issue. I meet the same situation.

I trained a model in pure Keras(2.2.4) + TF 1.15.0. For HeadPoseEstimation task,
I refered to the xiankg/HeadPoseEstimation-WHENet as my model and attempted to convert to a TF.js model.

So the question about the FixedDropout, Can I just subclass FixedDropout from Dropout in TensorFlow.js without overwriting the forward/call function?, does you solve it now?

And I'm new to TF.js, so I just wonder about the code. Can only refer the tensorflow.js official documents to deploy the code to mobile device or you use the other third party libraries available to help?

Thank you !

@bilaltahseen
Copy link

I am having the same issue when loading the model on raspberry Pi

@YifeiYang210
Copy link

I succeed to load it.
Subclass FixedDropout from Dropout MAY help!

@jclaessens97
Copy link

@YifeiYang210 how did you create a subclass from that Dropout? I'm only able to create a subclass from Layer

@elliestath
Copy link

any update on this? I would like to call FixedDropout as I do for the other layers, e.g. keras.layers.Conv2D
but keras.layers.FixedDropout gives an error AttributeError: module 'keras.layers' has no attribute 'FixedDropout'

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

5 participants