Skip to content

Commit

Permalink
fix the h5 conversion test (#7861)
Browse files Browse the repository at this point in the history
* fix the h5 conversion test

* fix
  • Loading branch information
fengwuyao committed Jul 26, 2023
1 parent bba2ba9 commit 310bdfd
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ def testConvertMergedModelFromSimpleModelNoSplitByLayer(self):
model = tf.keras.models.Model(inputs=[input_tensor], outputs=[output])
h5_path = os.path.join(self._tmp_dir, 'MyModelMerged.h5')
model.save(h5_path)
# Ensure matching legacy serialization format
model.use_legacy_config = True

if six.PY3:
config_json = json.loads(model.to_json())
else:
Expand Down Expand Up @@ -219,6 +222,9 @@ def testConvertMergedModelFromSimpleModelSplitByLayer(self):
model = tf.keras.models.Model(inputs=[input_tensor], outputs=[output])
h5_path = os.path.join(self._tmp_dir, 'MyModelMerged.h5')
model.save(h5_path)
# Ensure matching legacy serialization format
model.use_legacy_config = True

if six.PY3:
config_json = json.loads(model.to_json())
else:
Expand Down

0 comments on commit 310bdfd

Please sign in to comment.