Created
October 5, 2020 15:06
-
-
Save seatedro/8b1918bf3f13545bf667f86f2af77a6d to your computer and use it in GitHub Desktop.
Clean-up checkpoints
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
output_directory = 'exported-models/' | |
# goes through the model is the training/ dir and gets the last one. | |
# you could choose a specfic one instead of the last | |
lst = os.listdir("models/my_mobilenet/") | |
# print(lst) | |
lst = [l for l in lst if 'ckpt-' in l and '.index' not in l] | |
steps=np.array([int(re.findall('\d+', l)[0]) for l in lst]) | |
last_model = lst[steps.argmax()] | |
last_model_path = os.path.join('models/my_mobilenet', last_model) | |
# print(last_model_path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment