From e2bcb70355204c4e995699e8020f0bf2e032a734 Mon Sep 17 00:00:00 2001 From: fregu856 Date: Sun, 23 Sep 2018 14:17:11 +0200 Subject: [PATCH] > --- aspp.py | 2 +- deeplabv3.py | 2 +- preprocess_data.py | 6 +++--- train.py | 14 +++++++------- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/aspp.py b/aspp.py index 5ef1908..6a88f7a 100644 --- a/aspp.py +++ b/aspp.py @@ -1,4 +1,4 @@ -# camera-ready if everythng works (need to modify paths) +# camera-ready if everythng works import torch import torch.nn as nn diff --git a/deeplabv3.py b/deeplabv3.py index 2c3c1fd..0b33bf7 100644 --- a/deeplabv3.py +++ b/deeplabv3.py @@ -1,4 +1,4 @@ -# camera-ready if everything works (need to modify paths) +# camera-ready if everything works import torch import torch.nn as nn diff --git a/preprocess_data.py b/preprocess_data.py index fbaab21..7b3ba2c 100644 --- a/preprocess_data.py +++ b/preprocess_data.py @@ -1,4 +1,4 @@ -# camera-ready if everything works (need to modify paths) +# camera-ready if everything works import pickle import numpy as np @@ -94,8 +94,8 @@ val_dirs = ["frankfurt/", "munster/", "lindau/"] test_dirs = ["berlin", "bielefeld", "bonn", "leverkusen", "mainz", "munich"] -cityscapes_data_path = "/datasets/cityscapes" -cityscapes_meta_path = "/staging/frexgus/cityscapes/meta" +cityscapes_data_path = "/root/deeplabv3/data/cityscapes" +cityscapes_meta_path = "/root/deeplabv3/data/cityscapes/meta" if not os.path.exists(cityscapes_meta_path + "/label_imgs"): os.makedirs(cityscapes_meta_path + "/label_imgs") diff --git a/train.py b/train.py index 8f1bd39..a714273 100644 --- a/train.py +++ b/train.py @@ -1,4 +1,4 @@ -# camera-ready if everything works (need to modify paths) +# camera-ready if everything works from datasets import DatasetTrain, DatasetVal # (this needs to be imported before torch, because cv2 needs to be imported before torch for some reason) from deeplabv3 import DeepLabV3 @@ -28,12 +28,12 @@ batch_size = 16 learning_rate = 0.0001 -network = DeepLabV3(model_id, project_dir="/staging/frexgus/multitask").cuda() +network = DeepLabV3(model_id, project_dir="/root/deeplabv3").cuda() -train_dataset = DatasetTrain(cityscapes_data_path="/datasets/cityscapes", - cityscapes_meta_path="/staging/frexgus/cityscapes/meta") -val_dataset = DatasetVal(cityscapes_data_path="/datasets/cityscapes", - cityscapes_meta_path="/staging/frexgus/cityscapes/meta") +train_dataset = DatasetTrain(cityscapes_data_path="/root/deeplabv3/data/cityscapes", + cityscapes_meta_path="/root/deeplabv3/data/cityscapes/meta") +val_dataset = DatasetVal(cityscapes_data_path="/root/deeplabv3/data/cityscapes", + cityscapes_meta_path="/root/deeplabv3/data/cityscapes/meta") num_train_batches = int(len(train_dataset)/batch_size) num_val_batches = int(len(val_dataset)/batch_size) @@ -50,7 +50,7 @@ params = add_weight_decay(network, l2_value=0.0001) optimizer = torch.optim.Adam(params, lr=learning_rate) -with open("/staging/frexgus/cityscapes/meta/class_weights.pkl", "rb") as file: # (needed for python3) +with open("/root/deeplabv3/data/cityscapes/meta/class_weights.pkl", "rb") as file: # (needed for python3) class_weights = np.array(pickle.load(file)) class_weights = torch.from_numpy(class_weights) class_weights = Variable(class_weights.type(torch.FloatTensor)).cuda()