save only model, not everything
All checks were successful
s444354-training/pipeline/head This commit looks good
s444354-evaluation/pipeline/head This commit looks good

This commit is contained in:
Adrian Charkiewicz 2022-05-08 21:40:38 +02:00
parent 9ce0127a72
commit 5c792ac14c
2 changed files with 7 additions and 2 deletions

View File

@ -24,7 +24,7 @@ stages {
archiveArtifacts artifacts: 'pytorch/result.txt',
allowEmptyArchive: true
dir('my_runs') {
archiveArtifacts artifacts: '**/**'
archiveArtifacts artifacts: '**/*.pth'
}
}

View File

@ -170,7 +170,10 @@ def fit(epochs, lr, model, train_loader, val_loader, _log, opt_func=torch.optim.
result = evaluate(model, val_loader)
model.epoch_end(epoch, result, epochs)
history.append(result)
ex.add_artifact("saved_model.pb")
torch.save(model, 'saved_model.pth')
ex.add_artifact("saved_model.pth")
return history
@ -207,5 +210,7 @@ def main():
#my_config()
#print("number of epochs is: ", epochs)
history5 = fit()
#ex.run()