-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Cannot read properties of undefined (reading '_malloc') #8153
Comments
Hi, @pkesseli I apologize for the delayed response and could you please help us with your Github repo or sample code snippet (along with |
Hi @gaikwadrahul8, Thanks for your response. I created a minimal repro that you can download here: Steps to reproduce: npm install
npm run dev If you browse http://localhost:3000 and look at the development console, you should see the following output:
|
Apologies, the link expired today. Renewed it by another two weeks. |
Created a link for direct download that will last a year: |
Hi, @pkesseli I sincerely apologize for the delayed response and thank you for sharing the workable link and now I'm able to replicate the same behaviour from my end also so we'll have to dig more into this issue and will update you soon. thank you for bringing this issue to our attention. I also tried to replicate the same issue with latest version Thank you for your understanding and patience. |
Hello everyone i am using tensor flow lite version @tensorflow/[email protected] with peer dependency @tensorflow/[email protected]. also i am trying to load model like: But getting error: Cannot read properties of undefined (reading '_malloc')please help |
I had the exact same issue as @pkesseli, to the line. I was loading the libraries from a worker module environment (though I think the module environment was the key here) When trying to run tflite.loadModel, I observed no network requests to load the tflite_web_api_cc.js modules, and other files in the remote wasm folder, nor when manually specifying I know the model works because I use the same exact model with the same exact library files, to the version, when loaded directly from cdn in a script tag. I'm guessing the libraries by default assume loading from CDN as I've had other errors in the past working with tfjs-lite from npm, but I have never had issues using tflite-tfjs when loading from cdn. An unelegant workaround that I found was to create a worker that can load the scripts directly from CDN, that seems to work Parent:
Worker
The above seems to work for me. It doesn't work if you don't specify the remote If it's helpful for debugging, I was using a vite build system for a vue application, and the tfjs versions were:
I also tried @tensorflow/tfjs-tflite: 0.0.1-alpha.9 and that also had the same issue |
Thank you @sb2702 . I am able to successfully load model after setWasmPath tflite.setWasmPath('https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/wasm/') |
Thanks @mittalmohit, that does resolve my issue. However, as mentioned above, due to issue #7893 I was forced to use @tensorflow/[email protected]. Did you actually get @tensorflow/[email protected] to work? If so, how did you fix #7893? |
I am also experiencing both #7893 and this issue.
which works in importing the scripts but no matter how I import the scripts or which version I use I always get the Is there any other way around this? |
It looks like the code in the API client file is trying to load the simd.js file via I think this is the underlying error here. |
System information
I encountered this issue #7893 when using @tensorflow/[email protected]. So I regressed to @tensorflow/[email protected], as suggested in the issue. As a consequence of this downgrade, I had to use @tensorflow/[email protected], as illustrated in #7789.
With this setup, I tried to load a
.tfilte
model as follows:The output is the following:
The referenced line is the following:
Perhaps this is a result of using a woefully outdated TensorFlow.js version, so my question would be:
Thanks for any suggestions you can provide!
The text was updated successfully, but these errors were encountered: