Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Loading Movenet gives an undefined error for TFJS #891

Closed
MarioCavero opened this issue Aug 23, 2023 · 4 comments
Closed

Bug: Loading Movenet gives an undefined error for TFJS #891

MarioCavero opened this issue Aug 23, 2023 · 4 comments

Comments

@MarioCavero
Copy link

MarioCavero commented Aug 23, 2023

What happened?

I have been using movenet without any problems. I have been following the guide. I posted an issue in TFJS and it was tried following another methodology, which sometimes gives and sometimes does not give errors.

Does this happen sometimes? Is it possible to do it always locally if the model is downloaded, to avoid "no internet" issues?
If so:
I also loaded the movenet model for TFJS but there are no .predict or .estimatePoses methods. Is it possible to use the movenet pretrained model as a loading graph model, to do the same inferences as creating a detector from the model as the guide says, and doing .estimatePoses?

Relevant code

<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"></script>
  <script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/pose-detection"></script>

    await tf.setBackend('webgl');
    await tf.ready();

    const detectorConfig = {
      modelType: poseDetection.movenet.modelType.SINGLEPOSE_LIGHTNING,
    };
    const detector = await poseDetection.createDetector(poseDetection.SupportedModels.MoveNet, detectorConfig);

Relevant log output

pose-detection:17 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'loadGraphModel')
    at pose-detection:17:56068
    at pose-detection:17:2398
    at Object.next (pose-detection:17:2503)
    at pose-detection:17:1440
    at new Promise (<anonymous>)
    at u (pose-detection:17:1185)
    at Xt (pose-detection:17:55433)
    at Object.<anonymous> (pose-detection:17:71747)
    at pose-detection:17:2398
    at Object.next (pose-detection:17:2503)

And going to the source of the error in console:

case 2:
                    return a = void 0,
                    "SinglePose.Lightning" === e.modelType ? a = "https://tfhub.dev/google/tfjs-model/movenet/singlepose/lightning/4" : "SinglePose.Thunder" === e.modelType ? a = "https://tfhub.dev/google/tfjs-model/movenet/singlepose/thunder/4" : "MultiPose.Lightning" === e.modelType && (a = "https://tfhub.dev/google/tfjs-model/movenet/multipose/lightning/1"),
                    [4, i.loadGraphModel(a, {
                        fromTFHub: o
 })];

tensorflow_hub Version

? Following guide, installed for npm. Worked fine until today.

TensorFlow Version

2.8 (latest stable release)

Other libraries

No response

Python Version

3.x

OS

Linux

@herdiansah
Copy link

I have the same issue, My application suddenly has the same error "Uncaught TypeError: Cannot read properties of undefined (reading 'loadGraphModel') pose-detection:17"

I have try using simple code for multipose lightning testing:
const modelUrl = 'https://tfhub.dev/google/tfjs-model/movenet/multipose/lightning/1';
const model = await tf.loadGraphModel(modelUrl, {fromTFHub: true});
console.log(model);

I have this error:
Uncaught TypeError: Cannot read properties of undefined (reading 'loadGraphModel')
at pose-detection:17:56068
at pose-detection:17:2398
at Object.next (pose-detection:17:2503)
at pose-detection:17:1440
at new Promise ()
at u (pose-detection:17:1185)
at Xt (pose-detection:17:55433)
at Object. (pose-detection:17:71747)
at pose-detection:17:2398
at Object.next (pose-detection:17:2503)

above simple code used to be working fine.

@singhniraj08
Copy link

@MarioCavero,

Referring the TFJS issue filled by you, looks like the issue was from TFJS side and issue is happening with latest versions of @tensorflow-models/pose-detection@2.1.1 and @tensorflow-models/pose-detection@2.1.2 and it's working as expected with this version @tensorflow-models/pose-detection@2.1.0. The issue should be fixed with npm version@2.1.3.

Kindly let us know if this issue is resolved for you. Thank you!

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@herdiansah
Copy link

I have tested the updated pose-detection and now my application working fine.

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants