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

assets: draft for tfjs model for standard_v2_0 #666

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

reyammer
Copy link
Collaborator

@reyammer reyammer commented Aug 30, 2024

This is an attempt to convert standard_v2_0 to tfjs format.

The model is untested.

Steps:

  • Convert .keras model to saved_model format: tf.keras.models.save_model(model , './savedmodel/', save_format='tf')
  • Create a fresh python virtual environment with python<=3.11 (tensorflowjs breaks with python 3.12)
  • pip install tensorflowjs
  • tensorflowjs_converter --input_format=tf_saved_model --output_format=tfjs_graph_model ./savedmodel ./magika_tfjs

Notes:

  • the conversion to saved model is needed because we use custom layers, .keras does not store them, and I could not find a way to add custom layers to the scope of the tensorflowjs_converter CLI script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant