0cfe82c6beb9a28a5ff7da81b86fa0e93c388f14,tasks/save_reload_model.py,,,#,10
Before Change
if os.path.exists("tcn.npz"):
// Load checkpoint if file exists.
w = np.load("tcn.npz", allow_pickle=True)["w"]
print("Model reloaded.")
model.set_weights(w.tolist())
else:
// Save the checkpoint.
After Change
reloaded_model.load_weights(r"weights.h5")
// Make inference.
out2 = reloaded_model.predict(inputs)[0, 0]
print("*" * 80)
print("Inference after loading:", out2)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: philipperemy/keras-tcn
Commit Name: 0cfe82c6beb9a28a5ff7da81b86fa0e93c388f14
Time: 2019-11-20
Author: premy@cogent.co.jp
File Name: tasks/save_reload_model.py
Class Name:
Method Name:
Project Name: PPPLDeepLearning/plasma-python
Commit Name: 30f8696647af482f34e88661c43bf373b84a8da5
Time: 2017-05-29
Author: jk7@tigergpu.princeton.edu
File Name: plasma/models/shallow_runner.py
Class Name:
Method Name: train
Project Name: nilearn/nilearn
Commit Name: 311ac284d99ea7243e0918949f3a499a7a93fab5
Time: 2015-11-29
Author: gael.varoquaux@normalesup.org
File Name: examples/decoding/plot_haxby_space_net.py
Class Name:
Method Name: