mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-10 07:28:15 -05:00
hotfix check ckpts before writing achieved model (#3901)
this killed tinybox green run
This commit is contained in:
@@ -200,6 +200,7 @@ def train_resnet():
|
||||
|
||||
# save model if achieved target
|
||||
if not achieved and total_top_1 >= target:
|
||||
if not os.path.exists("./ckpts"): os.mkdir("./ckpts")
|
||||
fn = f"./ckpts/resnet50.safe"
|
||||
safe_save(get_state_dict(model), fn)
|
||||
print(f" *** Model saved to {fn} ***")
|
||||
|
||||
Reference in New Issue
Block a user