Przeglądaj źródła

fixed paths to Marvin data

Zan Klanecek 3 lat temu
rodzic
commit
0dc1bfc2ff

+ 2 - 2
5-naloga-cnn-klasifikacija-covid-slik/visualize_convolutions.py

@@ -23,8 +23,8 @@ if __name__ == '__main__':
     device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
     
     # Nalozimo testne podatke
-    main_path_to_data = "C:/Users/Klanecek/Desktop/processed" 
-    model_folder = "trained_models/testrun123_v2"
+    main_path_to_data = "/data/PSUF_naloge/5-naloga/processed" 
+    model_folder = "trained_models/testrun123"
     with open (os.path.join(main_path_to_data, "test_info.json")) as fp:
             test_info = json.load(fp) 
     

+ 1 - 1
5-naloga-cnn-klasifikacija-covid-slik/visualize_filters.py

@@ -6,7 +6,7 @@ import os
 
 device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
 
-model_folder = "trained_models/testrun123_v2/" # mapa naucenega modela
+model_folder = "trained_models/testrun123" # mapa naucenega modela
 model = ModelCT()
 model.to(device)
 model.load_state_dict(torch.load(os.path.join(model_folder, "trained_model_weights.pth")))

+ 2 - 3
5-naloga-cnn-klasifikacija-covid-slik/visualize_saliency.py

@@ -11,8 +11,8 @@ from scipy.ndimage import gaussian_filter
 
 if __name__ == "__main__":
     # Nalozimo testne podatke
-    main_path_to_data = "C:/Users/Klanecek/Desktop/processed" 
-    model_folder = "trained_models/testrun123_v2"
+    main_path_to_data = "/data/PSUF_naloge/5-naloga/processed"
+    model_folder = "trained_models/testrun123"
     
     with open (os.path.join(main_path_to_data, "test_info.json")) as fp:
             test_info = json.load(fp)   
@@ -20,7 +20,6 @@ if __name__ == "__main__":
     # Nalozimo model, ga damo v eval mode
     device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
 
-    model_folder = "trained_models/testrun123_v2/" # mapa naucenega modela
     model = ModelCT()
     model.to(device)
     model.load_state_dict(torch.load(os.path.join(model_folder, "trained_model_weights.pth")))