Skip to content

Converting *.h5 model with tfjs #8734

Description

@stewie-stew

I am working on a project where I need to convert my *.h5 model to use it with javascript, I wanted to convert the model with tensorflowjs using the code:

import tensorflowjs as tfjs
tfjs.converters.save_keras_model(model, "tfjs_models")

an error occured saying something about deprecated np.object type. I fixed this error by replacing np.object with object in file: /venv/lib/python3.13/site-packages/tensorflowjs/write_weights.py and /venv/lib/python3.13/site-packages/tensorflowjs/read_weights.py on lines 27 and 28.
But it did not help.

A new error saying module 'tensorflow.compat.v1' has no attribute 'estimator'

my system information

  • fedora linux 44
  • python 3.13.14
  • pip 26.1.2
  • tensorflow 2.21.0
  • tensorflowjs 3.18.0
  • keras 3.15.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions