Skip to content

Commit

Permalink
>
Browse files Browse the repository at this point in the history
  • Loading branch information
fregu856 committed Sep 23, 2018
1 parent f3324c8 commit e2bcb70
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion aspp.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion deeplabv3.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions preprocess_data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# camera-ready if everything works (need to modify paths)
# camera-ready if everything works

import pickle
import numpy as np
Expand Down Expand Up @@ -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")
Expand Down
14 changes: 7 additions & 7 deletions train.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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()
Expand Down

0 comments on commit e2bcb70

Please sign in to comment.