Closed philippogol closed 1 month ago
Hi, @philippogol
I apologize for the delay in my response and if possible could you please give it try with mentioned package dependancies here and see is it resolving your issue or not ?
If issue still persists please help us with complete error log and steps with your Github repo to replicate the same behavior from our end to investigate this issue further.
Thank you for your cooperation and patience.
hey @gaikwadrahul8 thanks for the coming back, its actually pretty forward and i think it should an easy fix. here are the steps and code im using for a simple tensorflow loading model (im avoiding expo since it should be possible to use tensorflow without any expo package)
In get the error: "Console Warning Possible unhandled promise rejection (id: 0): TypeError: Cannot read property 'fetch' of undefined" (see attachment).
hey @gaikwadrahul8 thanks for the coming back, its actually pretty forward and i think it should an easy fix. here are the steps and code im using for a simple tensorflow loading model (im avoiding expo since it should be possible to use tensorflow without any expo package)
- npx react-native init tensorflowApp
- npm install @react-native-async-storage/async-storage @tensorflow/tfjs @tensorflow/tfjs-react-native
- cd ios/ & pod install
- all code in App.tsx (starting tensorflow and loading model, see in repo)
In get the error: "Console Warning Possible unhandled promise rejection (id: 0): TypeError: Cannot read property 'fetch' of undefined" (see attachment).
Hi @philippogol ,
Apologies for the delayed response. I am unable to replicate the issue on my system, i'm encountering a different error.
The warning message Console Warning Possible unhandled promise rejection (id: 0):
suggests that the promise from await tf.ready()
might be rejected, which indicates that TensorFlow.js was not successfully initialized. This failure could be causing the error TypeError: Cannot read property 'fetch' of undefined.
You could use following set of code to check what exactly casuing the error.
tf.ready().then(async ()=>{
setIsTfReady(true);
// Load the MobileNet model
const model = await tf.loadLayersModel('https://storage.googleapis.com/tfjs-models/tfjs/mobilenet_v1_0.25_224/model.json');
setModel(model);
}).catch(e=> console.log('Error while loading the tf dependencies.',e));
Let me know if it helps. Thank You!!!
This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.
This issue was closed due to lack of activity after being marked stale for past 7 days.
@philippogol @gaikwadrahul8 I am having similar issues, as logged in #8429
Could you please give it try with mentioned package dependancies here and see is it resolving your issue or not ?
I cannot downgrade my current environment, so it leads me to believe that there is some incompatibility with new versions of React Native
I'm encountering a constant error while fresh starting a new project. These are the dependencies:
"dependencies": { "@react-native-async-storage/async-storage": "^1.24.0", "@tensorflow/tfjs": "^4.20.0", "@tensorflow/tfjs-react-native": "^1.0.0", "react": "18.2.0", "react-native": "0.74.3" }
Making a simple addition using or just loading the package library throws the error "Cannot read property 'isTypedArray' of undefined. I tried different things and is not working, has someone experienced something like this or has a solution? Thanks.