Skip to content

Commit

Permalink
try something
Browse files Browse the repository at this point in the history
  • Loading branch information
philipperemy committed Aug 13, 2024
1 parent de9c2d6 commit 75e87b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tasks/save_reload_sequential_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
with open('model.json', "w") as json_file:
json_file.write(model_as_json)
# save weights to file (for this format, need h5py installed)
model.save_weights('weights.h5')
model.save_weights('model.weights.h5')

# Make inference.
inputs = np.ones(shape=(1, 100))
Expand All @@ -36,7 +36,7 @@
tcn_full_summary(model, expand_residual_blocks=False)

# restore weights
reloaded_model.load_weights('weights.h5')
reloaded_model.load_weights('model.weights.h5')

# Make inference.
out2 = reloaded_model.predict(inputs)[0, 0]
Expand Down

0 comments on commit 75e87b3

Please sign in to comment.