question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tfjs-react-native: Error ‘func is not a function’

See original GitHub issue

TensorFlow.js version

@tensorflow/tfjs”: “^2.3.0” “@tensorflow/tfjs-react-native”: “^0.3.0”

Describe the problem or feature request

Hi. I’m trying to run tfjs-react-native project realtime_demo with my android smartphone, but I’m stuck with TensorCamera.

My project directory is here, and if you need more files to inspect error just ask. The error I’m getting is this.

error2

When I debugged my project, I found out that when TensorCamera triggers onReady and calls handleImageTensorReady, the first argument of handleImageTensorReady - which is images - are not passed properly thus undefined. That’s why my code gets stuck when const imageTensor = images.next().value; is called.

I’m using bare workflow with react-native-unimodules attached manually, but just to check I also tried using expo-managed-example. It throws the same func is not a function error.

What is causing this problem? Is it because the testing device I’m using too old to run tensorflow modules? Plz help.

ps1.

I’m sure this error is not related to loading tensorflow models (blazeface, posenet) because when I comment out all model-related codes from the demo project, I still get same func is not a function error.

I’m sure TensorCamera is the problem because when I changed TensorCamera to ordinary Camera module from “expo-camera”, no error occurred.

ps2.

I’ve borrowed Galazy S20 from one of my friends and test the project, and I got the some error. The problem was not with smartphone itself.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
tafsiricommented, Sep 14, 2020

I think we have a bug in 2.3.0, so I would suggest downgrading to an earlier version until our next release is out (should be this week).

2reactions
CPLTOMcommented, Sep 10, 2020

Same for me, the TensorCamera component does not render properly and give the error described above.

    "@tensorflow/tfjs": "^2.3.0",
    "@tensorflow/tfjs-automl": "^1.0.0",
    "@tensorflow/tfjs-react-native": "^0.3.0",
    "expo-av": "^8.4.0",
    "expo-camera": "^8.3.1",
    "expo-gl": "^8.4.0",
    "expo-gl-cpp": "^8.4.0",
    "expo-image-manipulator": "^8.2.1",
    "expo-permissions": "^9.1.0",
Read more comments on GitHub >

github_iconTop Results From Across the Web

t is not a function error in meteor app with react and tensorflow
I'm working on a meteor app using react and tensorflow, the problem is that the console is throwing this error every time I...
Read more >
Latest TF.js topics - TensorFlow Forum
Topic Replies Views Activity About the SIG TF.js category 0 1158 April 13, 2021 Dynamic optimizer · tfjs , models , help_request 0 361 September...
Read more >
Tensorflow.js tf.loadLayersModel() Function - GeeksforGeeks
A string path to the ModelAndWeightsConfig JSON file that describes the model in TensorFlow.js format. For the file:// (tfjs-node-only), ...
Read more >
TypeError: trackerFn(...).registerTensor is not a function-node.js
I had the exact same error and while I was trying to fix this error other ones came out this went on and...
Read more >
Real Time Image Classification with TensorFlow and React ...
[tensorflow/tfjs: 2.0.0] function callAndCheck(gl, debugMode, func) {...} And from tsjs-react-native, the callAndcheck is passing in: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found