tensorflow / tfjs

A WebGL accelerated JavaScript library for training and deploying ML models.
https://js.tensorflow.org
Apache License 2.0
18.25k stars 1.92k forks source link

Tensor flow installing issue in react native #7909

Open ehtshamaziz opened 10 months ago

ehtshamaziz commented 10 months ago

System information

Describe the problem I clone the repo from "https://github.com/tensorflow/tfjs-examples" and gone inside repo react-native/pose-detection. I install using yarn install but it gives me following warning : "Install individual packages by running npx expo install expo-camera@~12.5.0 react-native@0.69.9" and by running yarn start camera screen is black and it has a label which says 2/3 Fps.

gaikwadrahul8 commented 10 months ago

Hi, @ehtshamaziz

Thank you for bringing this issue to our attention and I tried to replicate the same issue from my end on my Mac M1 system and when I'm trying to use Expo Go application which I downloaded from Google play store it's giving me error stating " This project uses SDK 46.0.0 but this version of Expo Go only supports the following SDKs: 49.0.0,48.0.0,47.0.0. To load the project, it must be updated to supported SDK version or older version of Expo Go must be used " on my one plus mobile device

In your case, It seems like it's running but it's giving you 2/3 FPS (Frame per second) so may be due mobile device configuration if you're trying on mobile device if I'm not wrong at the moment

If the demo app crashes on startup, it is highly likely caused by incompatible package versions, specifically expo-gl and react-native. As of Jan 2022, please refer this official documentation

Could you please try with different mobile device and see is it working as expected or not ? If not please help us with error log and output screenshot to dig more into this issue ? Thank you!

ehtshamaziz commented 10 months ago

The camera works for 2-3 seconds and then it gets stuck with following errors:

Error: Argument 'x' passed to 'cast' must be a Tensor or TensorLike, but got 'Tensor' Error: Argument 'x' passed to 'cast' must be a Tensor or TensorLike, but got 'Tensor'

Edited: I resolved this error by adding following but it has now same issue the camera is too slow it only catches 2/3 FPS . "expo": {.... "jsEngine": "jsc",}