Skip to content

[tfjs-tflite] Loading second TFLite model hangs in _emscripten_futex_wait #6094

Open
@reuben

Description

@reuben

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow.js): Yes
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS 12.1
  • TensorFlow.js installed from (npm or script link):
<!-- Import @tensorflow/tfjs-core -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-core"></script>
<!-- Adds the CPU backend -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-cpu"></script>
<!--
Import @tensorflow/tfjs-tflite
Note that we need to explicitly load dist/tf-tflite.min.js so that it can
locate WASM module files from their default location (dist/).
-->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-tflite/dist/tf-tflite.min.js"></script>
  • Browser version: Chrome 97

Describe the current behavior

Trying to load two TFLite models causes the browser to hang on the second tflite.loadTFLiteModel call.

Describe the expected behavior

Being able to load more than a single model at a time.

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.

I don't have an easy way to share the model files but here's the entire script: https://gist.github.com/reuben/4d1a77251ad73629f54429705ab022a9

Copy two TFLite model files to a folder and name one of them featurizer.tflite and the other output_graph.tflite, then open taht page, click the model picker and select both files. The script loops forever inside _emscripten_futex_wait on the second tflite.loadTFLiteModel call.

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.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions