Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while trying to access files in the app

Tags:

I'm building a react-native app that uses tensorflow to recognize images, I'm following the steps in this tutorial.

I did everything according to the explanations, including the part of "Fetching files". I created the assets folder and put the files in it (the path is correct).

But when I run this code:

const tfImageRecognition = new TfImageRecognition({
    model: require('./assets/tensorflow_inception_graph.pb'),
    labels: require('./assets/tensorflow_labels.txt'),
});

The app gives the following error:

enter image description here

I already tried to create a new project, I imported the react-native-tensorflow import { TfImageRecognition } from 'react-native-tensorflow';, I updated the cache, I deleted the folder node_modules and also I created the file "rn-cli.config.js" that is requested in the tutorial to give access to the files in the assets folder. Any idea how to fix this?

I'm using expo to run the app on mobile (android).

  • npm: 5.51
  • expo: 51.4.0
  • react-native: 0.54.0
  • react-native-cli: 2.0.1
like image 296
Mathiasfc Avatar asked Apr 10 '18 17:04

Mathiasfc


1 Answers

This problem didn't occur with me. Try react-native start --reset-cache and then run the app again.

like image 163
Aavgeen singh Avatar answered Sep 28 '22 07:09

Aavgeen singh