PAIR-code / what-if-tool

Source code/webpage/demos for the What-If Tool
https://pair-code.github.io/what-if-tool
Apache License 2.0
892 stars 165 forks source link

Uncaught (in promise) Error: Tensorflow Op is not supported: _FusedConv2D #233

Open brrbaral opened 5 months ago

brrbaral commented 5 months ago

Hi, I tried to build the web demo using: bazel run wit_dashboard/demo:imagedemoserver

I got the error:

Uncaught (in promise) Error: Tensorflow Op is not supported: _FusedConv2D
    at t.mapNode (image.html:76874:708586)
    at image.html:76874:707992
    at Array.reduce (<anonymous>)
    at t.transformGraph (image.html:76874:707952)
    at t.<anonymous> (image.html:76874:743398)
    at image.html:76874:673788
    at Object.next (image.html:76874:673893)
    at a (image.html:76874:672663)

The same error is in web demo as well: https://pair-code.github.io/what-if-tool/demos/image.html

jameswex commented 5 months ago

The issue most likely has to do with version numbers of dependencies. The What-If Tool is an old project at this point and was last built against old versions of downstream dependencies. In general, it has been obsoleted by our follow-up tool, LIT (https://pair-code.github.io/lit/, https://github.com/PAIR-code/lit/).

If you wish to try to get the build to work, you may need to work off of an older version of TensorFlow JS than what you currently have installed.

In general, I recommend you look towards more up-to-date tools such as LIT, depending on your task.

taposh commented 5 months ago

Same error on the Pair-code website as well.

image
jameswex commented 5 months ago

Thanks, I see the issue and am looking into a solution. It seems that the model files for the image classifier that we used from tensorflow.js got moved and now when our demo is redirected to its new location, it is getting a new version of the model files that doesn't match our tensorflow.js version we use in the demos.

jameswex commented 5 months ago

I have fixed the deployed version by making the following change to the compiled image demo html file: https://github.com/PAIR-code/what-if-tool/commit/a410765966ad256332b8e67e6cab6fc6d51ef536

I have not made any change to the source code that would fix this issue in anyone building the demo locally. That would require updating our tf.js version and mobilenet version in our bazel workspace most likely, and then perhaps some code updates for the newer versions of those libraries.

taposh commented 5 months ago

Works now ! thank you @jameswex