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

Issue while running GraphModel predict #8508

Open
sivarajakani opened this issue Feb 5, 2025 · 2 comments
Open

Issue while running GraphModel predict #8508

sivarajakani opened this issue Feb 5, 2025 · 2 comments
Assignees
Labels
type:bug Something isn't working

Comments

@sivarajakani
Copy link

I'm encountering an undefined variable issue while running inference with the GraphModel in TensorFlow.js. It's occurring in tfjs-converter/src/operations/executors/utils.ts#L138.

System Information:

  • OS: Ubuntu 24
  • TensorFlow.js Version: v4.22.0 / v4.5.0 (installed via npm)
  • Browser: Firefox 134.0.2
  • TensorFlow.js Converter Version: v4.5.0
  • TensorFlow Version: v2.1.0

Current Behavior:
Inference fails due to an undefined variable, leading to a TypeError.

Expected Behavior:
The GraphModel should execute inference without errors.

Minimal Reproducible Code (in HTML):

<!DOCTYPE html>
<html lang="en">
<head>
    <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs/dist/tf.min.js"></script>
</head>
<body>
    <script>
        async function run() {
            const model = await tf.loadGraphModel('./model.json');
            
            const tensor = tf.zeros([1, 320, 320, 3]);

            const result = model.predict({"input": tensor});
        }

        run();
    </script>
</body>
</html>

I have attached the model to reproduce the issue

tfjs_graph.zip

Error Log (from Node):

TypeError: Cannot read properties of undefined (reading 'split')

      at parseNodeName (tfjs-converter/src/operations/executors/utils.ts:138:22)
      at getTensor (tfjs-converter/src/operations/executors/utils.ts:74:29)
      at getParamValue (tfjs-converter/src/operations/executors/utils.ts:53:20)
...

Any insights on resolving this issue?

@sivarajakani sivarajakani added the type:bug Something isn't working label Feb 5, 2025
@shmishra99 shmishra99 self-assigned this Feb 6, 2025
@shmishra99
Copy link
Contributor

Hi @sivarajakani ,

I've reproduced the issue you're experiencing, and it appears to be specific to your model.json file. I've successfully run other model without any problems.

To help me understand the root cause, could you please share details about the origin of your model and the steps you took to convert or create it? Thank You!!

@sivarajakani
Copy link
Author

Model Source:
I'm using CenterNet from TensorFlow Object Detection. Here is the saved_model.zip.

Model Conversion Script:

tensorflowjs_converter --input_format=saved_model <save_model_path> <destination_path>

TensorFlow.js Converter Version: v4.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants