hugozanini / TFJS-object-detection

Real-time custom object detection in the browser using tensorflow.js
Apache License 2.0
126 stars 67 forks source link

Cannot read property 'children' of undefined with using Tensorflow Object Detection API model in tfjs #9

Open dewball345 opened 3 years ago

dewball345 commented 3 years ago

System information

Hyperlinks are capitalized to prevent confusion(because the color settings(and blue filter) on my monitor make it hard to see the difference between them)

Describe the current behavior I used transfer learning using a pretrained model from the Tensorflow Object Detection API, which i converted to tensorflow-js using the tensorflow-converter API in python. View the ipynb notebook HERE. I then followed @hugozanini's REPO which had a template for using your tensorflow object detection models in javascript; I copied the index.json file and put it into a sandbox, replacing his model.json file with mine. The repo which contains it can be found here

Describe the expected behavior I was expecting the model to work and the program to run normally, like it did in this DEMO. Instead, I got

index.js:1437 TypeError: Cannot read property 'children' of undefined
    at operation_mapper.js:409
    at Array.forEach (<anonymous>)
    at operation_mapper.js:403
    at Array.forEach (<anonymous>)
    at OperationMapper.mapFunction (operation_mapper.js:401)
    at operation_mapper.js:163
    at Array.reduce (<anonymous>)
    at OperationMapper.transformGraph (operation_mapper.js:162)
    at GraphModel.loadSync (graph_model.js:159)
    at GraphModel._callee$ (graph_model.js:119)
    at tryCatch (runtime.js:62)
    at Generator.invoke [as _invoke] (runtime.js:288)
    at Generator.prototype.<computed> [as next] (runtime.js:114)
    at asyncGeneratorStep (asyncToGenerator.js:3)
    at _next (asyncToGenerator.js:25)

Standalone code to reproduce the issue Provide a reproducible test case that is the bare minimum necessary to generate the problem. If possible, please share a link to Colab/CodePen/any notebook.

HERE is the colab notebook I used to train my model HERE is the sandbox where I tried to use the tensorflow.js model

Other info / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

Error Message:

index.js:1437 TypeError: Cannot read property 'children' of undefined
    at operation_mapper.js:409
    at Array.forEach (<anonymous>)
    at operation_mapper.js:403
    at Array.forEach (<anonymous>)
    at OperationMapper.mapFunction (operation_mapper.js:401)
    at operation_mapper.js:163
    at Array.reduce (<anonymous>)
    at OperationMapper.transformGraph (operation_mapper.js:162)
    at GraphModel.loadSync (graph_model.js:159)
    at GraphModel._callee$ (graph_model.js:119)
    at tryCatch (runtime.js:62)
    at Generator.invoke [as _invoke] (runtime.js:288)
    at Generator.prototype.<computed> [as next] (runtime.js:114)
    at asyncGeneratorStep (asyncToGenerator.js:3)
    at _next (asyncToGenerator.js:25)
tigertall commented 2 years ago

maybe you can see issue #5