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

TFJS converter mismanages EfficientDet models 2 #5013

Closed
partus opened this issue Apr 29, 2021 · 7 comments
Closed

TFJS converter mismanages EfficientDet models 2 #5013

partus opened this issue Apr 29, 2021 · 7 comments
Assignees
Labels
type:bug Something isn't working

Comments

@partus
Copy link

partus commented Apr 29, 2021

Efficientdet can't be used , it relates to #3903, but seems to be a completely different one
For this model

Converted the following way

tensorflowjs_converter \
    --input_format=tf_hub  \
    --output_format=tfjs_graph_model \
    --signature_name=serving_default \
    --saved_model_tags=serve \
    ./efficientdet_d0_1 ./web_model_tfhub

Loaded and executed as follows in a browser

const model = await tf.loadGraphModel("web_model_tfhub/model.json");
t = tf.browser.fromPixels(img).expandDims(0)
let output = await model.executeAsync(t)

Results in

Uncaught Error: FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.
    at UO (tfjs@2.7.0:17)
    at tfjs@2.7.0:17
    at tfjs@2.7.0:17
    at tfjs@2.7.0:17
    at e.t.scopedRun (tfjs@2.7.0:17)
    at e.t.tidy (tfjs@2.7.0:17)
    at lx (tfjs@2.7.0:17)
    at tfjs@2.7.0:17
    at KO (tfjs@2.7.0:17)
    at p (tfjs@2.7.0:17)

Same when the model is taken from the official repo.

Tried both tfjs version 2.7.0 , which was released just after #3903 was resolved , and 3.6.0, the result is the same

@partus partus added the type:bug Something isn't working label Apr 29, 2021
@rthadur rthadur self-assigned this Apr 29, 2021
@pyu10055
Copy link
Collaborator

@partus I was able to convert and run the TFJS model without errors. Please make sure your tensorflowjs pip is the same version (3.6.0) as the tfjs library.

@partus
Copy link
Author

partus commented Apr 30, 2021

What versions of other packages are relevant? : I am running it on Arch linux, hence the most recent tensorflow + python as well, e.g. tensorflow with python 3.9... is not officially supported. Which are the important dependencies so that I will I will put it into a cantainer, Hopefully veryify that it’s fine. Then with the next step we might verify the issue in a container with upgraded versions

@Linh0704
Copy link

Linh0704 commented Jun 2, 2021

@partus Have you resolved this issue, I've countered the same one. Change tfjs version and tensorflowjs won't work
Uncaught Error: FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.

@partus
Copy link
Author

partus commented Jun 3, 2021

@Linh0704 , @pyu10055 I was able to convert and run the tfhub version with python 3.8 instead of 3.9, and tfjs 3.6.0 , but I was unable to run the model from the official repo. Did not dive into it further as decided to run the model on a server.

@rthadur
Copy link
Contributor

rthadur commented Jun 8, 2021

Closing the issue , please mention@ if you need further help to reopen. Thank you

@rthadur rthadur closed this as completed Jun 8, 2021
@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@npip99
Copy link

npip99 commented Feb 23, 2022

@rthadur I get the same issue right now, on npm tensorflowjs@3.13.0, with pip version of tensorflow==2.7, tensorflowjs==3.13.0

tensorflowjs_converter --input_format=tfjs_layers_model --output_format=tfjs_graph_model
    ./models/MyModel/model.json ./models/MyGraphModel
let graphModel = await tf.loadGraphModel('file://' + path.resolve('models', 'MyGraphModel', 'model.json'));
graphModel.predict(...);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants