react-native-tensorflow icon indicating copy to clipboard operation
react-native-tensorflow copied to clipboard

UnableToResolveError: Unable to resolve module

Open fazeelCGI opened this issue 6 years ago • 8 comments

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)

fazeelCGI avatar May 10 '18 10:05 fazeelCGI

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

reneweb avatar Jun 04 '18 22:06 reneweb

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.

SpQuyt avatar Jul 23 '18 02:07 SpQuyt

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

vibss2397 avatar Oct 04 '18 15:10 vibss2397

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

HarshitPKing avatar Feb 04 '19 06:02 HarshitPKing

hey I'm also having the same problem please help

chirag773 avatar May 04 '19 08:05 chirag773

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

vibss2397 avatar May 04 '19 09:05 vibss2397

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

chirag773 avatar May 04 '19 09:05 chirag773

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.

blindguydiy avatar Oct 06 '19 10:10 blindguydiy