From 3e2c776b3e7a402156dad893fc150a098f834d70 Mon Sep 17 00:00:00 2001 From: flifloo Date: Sat, 3 Apr 2021 22:40:37 +0200 Subject: [PATCH] Change data path to a relative path --- main.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index 38d807e..ce3a9f8 100644 --- a/main.py +++ b/main.py @@ -1,5 +1,5 @@ from functools import partial -from os.path import join +from os.path import join, abspath from numpy.random import randint from ray import tune @@ -59,13 +59,9 @@ def main(data_root, num_samples=10, max_num_epochs=10, gpus_per_trial=1): best_checkpoint_dir, "checkpoint")) best_trained_model.load_state_dict(model_state) - # If Pytorch don't save the end - print("In case saving...") - save(best_trained_model, "/home/flifloo/IA/model.pth") - print("Testing accuracy...") print(f"Best trial test set accuracy: {test_accuracy(best_trained_model, data_root, device)}") if __name__ == "__main__": - main("/home/flifloo/IA/data") + main(abspath("data"))