[tfjs-react-native] Can't import tensorflow when creating project with react native CLI
See original GitHub issueSystem information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: Pixel C API 30 (Emulator)
- TensorFlow.js installed from (npm or script link): https://www.npmjs.com/package/@tensorflow/tfjs
- TensorFlow.js version: @tensorflow/tfjs@3.9.0
- CUDA/cuDNN version: 11.1
Describe the problem I tried following the instructions for installing tfjs-react-native on a completely new project created with React Native CLI: https://www.npmjs.com/package/@tensorflow/tfjs-react-native.
After completing the installation, I try to import tfjs with these lines in App.js:
import * as tf from '@tensorflow/tfjs';
import '@tensorflow/tfjs-react-native';
I get the following error:
ERROR Error: Cannot evaluate flag 'DEBUG': no evaluation function found.
This does not happen when I set up the project with Expo instead of the React Native CLI. However, I need to find a fix for the problem because I need tfjs-react-native for an existing project that is not set up with Expo. I initially ran into the same issue on the original project, so this is why I created a blank project to investigate the issue.
Provide the exact sequence of commands / steps that you executed before running into the problem
Setting up the project:
react-native init TestProject
cd TestProject
npm install react-native-unimodules
npm install expo-gl-cpp expo-gl
npm install expo-camera
npm install @react-native-async-storage/async-storage
npm i react-native-fs
npm install @tensorflow/tfjs
npm install @tensorflow/tfjs-react-native
Then, I import tensorflow in App.js as mentioned above and run the app with:
react-native run-android
Any other info / logs
Error:
ERROR Error: Cannot evaluate flag 'DEBUG': no evaluation function found.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12
Top GitHub Comments
I couldn’t find a concrete answer to the question. Does tensorflow support react-native CLI, or it supports only EXPO projects ? Thanks!
@mmilenkoski Did it work for you with
inlineRequires: false
? I’m getting the same behavior as you do.