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

Error: 'prod' not yet implemented or not found in the registry. Did you forget to import the kernel? #3849

Closed
HaiDang9719 opened this issue Aug 24, 2020 · 7 comments
Labels
comp:wasm type:feature New feature or request

Comments

@HaiDang9719
Copy link

To get help from the community, we encourage using Stack Overflow and the tensorflow.js tag.

TensorFlow.js version

2.3.0, TF version: 2.3.0

Browser version

Chrome Version 84.0.4147.135 (Official Build) (64-bit), Firefox 79.0 (64-bit)

Describe the problem or feature request

I have tried with WebGL and CPU, it works fine. However, when I use wasm, it shows the error "'prod' not yet implemented or not found in the registry. Did you forget to import the kernel?"
In the worker.js file, I tried to add the library as follow:

https://cdn.jsdelivr.net/npm/@tensorflow/tfjs/dist/tf.min.js'); importScripts('https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm/dist/tf-backend-wasm.js') tf.setBackend('wasm').then(() => {})

I also tried without web worker and defined as follow but it also did not works:

<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs/dist/tf.min.js"></script>
 <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm/dist/tf-backend-wasm.js"></script>
    <script>
     tf.setBackend('wasm').then(() => );
    </script>

When I tried to visualize the model with Netron, I figured out there is a 'prod' node in the model:
Image

The 'prod' node is defined in Netron as "Computes the product of elements across dimensions of a tensor. Reduces input along the dimensions given in reduction_indices. Unless keep_dims is true, the rank of the tensor is reduced by 1 for each entry in reduction_indices. If keep_dims is true, the reduced dimensions are retained with length 1."

And this structure belongs to the function tf.reduce_sum() and tf.reduce_max() that I used in the Tensorflow model. I converted the Tensorflow as Saved_model format (*.pb) and then converted it to TFJS.

Any help is appreciated, thank you.

Code to reproduce the bug / link to feature request

If you would like to get help from the community, we encourage using Stack Overflow and the tensorflow.js tag.

GitHub issues for this repository are tracked in the tfjs union repository.

Please file your issue there, following the guidance in that issue template.

@rthadur
Copy link
Contributor

rthadur commented Aug 25, 2020

@HaiDang9719 can you please check a similar issue here ?

@HaiDang9719
Copy link
Author

@rthadur I did not use web pack or any backend in my project. I used client-side execution for the project (pure JS and HTML), so it does not have package.json or something similar in your mentioned issue.

@y-ich
Copy link

y-ich commented Sep 14, 2020

I have a same issue. Any workarounds?

@tafsiri
Copy link
Contributor

tafsiri commented Sep 14, 2020

Hi, in this case prod has not yet been implemented in the WASM backend. You would need to use either CPU or WebGL backends. I'll take this as a feature request to add prod.

@y-ich
Copy link

y-ich commented Sep 15, 2020

@tafsiri san,

Thank you for your comments!
I am looking forward to implementation of prod on wasm.

@rthadur
Copy link
Contributor

rthadur commented Oct 29, 2020

related PR has been merged and will be available in next release. Thank you

@y-ich
Copy link

y-ich commented Nov 18, 2020

When will version 2.8.0 be released?
I am tired of waiting for prod support;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:wasm type:feature New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants