Skip to content

Saving / Loading Large Models in IndexedDB Causes OOM #7702

@mattsoulanille

Description

@mattsoulanille

Please make sure that this is a bug. As per our
GitHub Policy,
we only address code/doc bugs, performance issues, feature requests and
build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow.js):
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): MacOS 12.6.3
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
  • TensorFlow.js installed from (npm or script link): Custom
  • TensorFlow.js version (use command below): After Support loading models with weights above 2GB on Chrome #7609
  • Browser version: Chrome 113
  • Tensorflow.js Converter Version: N/A

Describe the current behavior
Saving a large model (near 2 GB) to IndexedDB will consistently fail with an out of memory error. This seems to be a regression caused by #7609.

Describe the expected behavior
Saving and loading a large model in IndexedDB works.

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.

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.

DOMException: Failed to execute 'put' on 'IDBObjectStore': Data cannot be cloned, out of memory.
    at putInfoRequest.onsuccess

Metadata

Metadata

Labels

type:bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions