tf_keras doesn't run in colab, revert back to tf.keras for working demo

This commit is contained in:
Howard Chiam 2024-01-29 20:49:46 -07:00 committed by GitHub
parent d1d8d08c04
commit 38c41edb89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 2 deletions

View File

@ -45,10 +45,9 @@ import tensorflow as tf
import tensorflow_decision_forests as tfdf
import tensorflowjs as tfjs
from google.colab import files
import tf_keras
# Load the model with Keras
model = tf_keras.models.load_model("/tmp/my_saved_model/")
model = tf.keras.models.load_model("/tmp/my_saved_model/")
# Convert the keras model to TensorFlow.js
tfjs.converters.tf_saved_model_conversion_v2.convert_keras_model_to_graph_model(model, "./tfjs_model")