react-native-tensorflow
react-native-tensorflow copied to clipboard
UnableToResolveError: Unable to resolve module
I have installed the library and trying to use the available example. When I am loading the model from../asset/tensorflow_inception_graph.pb
then it is giving me the error that unable to resolve the module. I have checked the path of model which is correct. Can anyone help to resolve this? Below I am showing the error log
error:
bundling failed: UnableToResolveError: Unable to resolve module ../asset/tensorflow_inception_graph.pb
from /Users/fazeel/CGapp/code/LoginDemo/src/screens/ImageRecognitionAI.js
: could not resolve `/Users/fazeel/CGapp/code/LoginDemo/src/asset/tensorflow_inception_graph.pb' as a file nor as a folder
at ModuleResolver._loadAsFileOrDirOrThrow (/Users/fazeel/CGapp/code/LoginDemo/node_modules/metro-bundler/src/node-haste/DependencyGraph/ModuleResolution.js:337:11)
It looks like it can't find the tensorflow_inception_graph.pb
as a react native module. Have you made sure to add the rn-cli.config.js
as described here: https://github.com/reneweb/react-native-tensorflow#fetching-files
https://stackoverflow.com/questions/50285949/unable-to-resolve-module-tensorflow-inception-graph-pb-as-a-file-nor-as-a-folder This helped me a lot. You should watch this.
hey, i am having the same problem, i have dont everything, checked the paths, added the rn-cli.confing.js file, but still it doesnt seem to work any help would be appreciated
hey, I am having the same problem, I have done everything, checked the paths, added the rn-cli.confing.js file, but still, it doesn't seem to work any help would be appreciated
hey I'm also having the same problem please help
React native has good documentation of how to integrate native modules , you need to have a base class which has all the functions, a module and a package file which act as a wrapper and integrate them into react native, check this out for an image classifier:
https://github.com/vibss2397/See-Things/tree/master/android/app/src/main/java/com/seethings
This is the react native docs link:
https://facebook.github.io/react-native/docs/native-modules-android
This package didn't work out for me
const text = {uri: './assets/tensorflow_labels.txt'}; const graph = {uri: './assets/tensorflow_inception_graph.pb'}; const tfImageRecognition = new TfImageRecognition({ model: graph, labels: text });
this worked for me but now i'm gettiing an another error
Error:Could not load resource
Have the same problem and also with other image classification examples. I personnally think the people putting the examples up should give better explenations and how there examples work. Also I think they should put examples on that work.