Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tfjs-converter/python/tensorflowjs/converters/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def dispatch_tensorflowjs_to_keras_saved_model_conversion(
with tf.Graph().as_default(), tf.compat.v1.Session():
model = keras_tfjs_loader.load_keras_model(config_json_path)
tf.keras.models.save_model(
model, keras_saved_model_path)
model, keras_saved_model_path, save_format='tf')


def dispatch_tensorflowjs_to_tensorflowjs_conversion(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ def testConvertTfKerasNestedSequentialSavedAsSavedModel(self):
model = self._createNestedSequentialModel()
old_model_json = json.loads(model.to_json())
old_weights = model.get_weights()
tf.keras.models.save_model(model, self._tmp_dir)
tf.keras.models.save_model(model, self._tmp_dir, save_format='tf')

# Convert the keras SavedModel to tfjs format.
tfjs_output_dir = os.path.join(self._tmp_dir, 'tfjs')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@

import tensorflow.compat.v2 as tf

tf.enable_eager_execution()


def parse_args():
parser = argparse.ArgumentParser(
'Generates saved model artifacts for testing.')
Expand All @@ -51,7 +48,7 @@ def main(_):
model.add(tf.keras.layers.Dense(1, activation='sigmoid'))
model.save(os.path.join(args.output_path))
elif args.model_type == 'tf_saved_model':
class TimesThreePlusOne(tf.train.Checkpoint):
class TimesThreePlusOne(tf.Module):

@tf.function(input_signature=[
tf.TensorSpec(shape=None, dtype=tf.float32)])
Expand Down