-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel_arts_train.py
More file actions
39 lines (38 loc) · 2.35 KB
/
Copy pathmodel_arts_train.py
File metadata and controls
39 lines (38 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from utils.operation import *
from utils.file import *
import argparse
if __name__ == '__main__':
print("start model arts train.")
parser = argparse.ArgumentParser()
parser.add_argument('--data_url', required=True, type=str, help='the training and validation data path')
parser.add_argument('--train_url', required=True, type=str, help='the path to save training outputs')
parser.add_argument('--init_method', default='', type=str, help='the training output results on local')
opt = parser.parse_args()
print(opt)
# train(in_channels=3, out_channels=8, net_name="deeplabv3", lr=0.001, csv_path="seed-project/data_list/train.csv",
# load_data=copy_dataset(copy_to_local_root="/cache/datasets",
# source_data_path='s3://zlf-rubbish-data/datasets/original.zip'),
# batch_size=16, resize=(512, 512), crop_offset=(730, 0),
# epoch_begin=0, epoch_num=5,
# num_classes=8,
# save_model=save_model(local_root="/cache/model", copy_root="s3://zlf-rubbish-data/outputs/"),
# load_resnet_weight=load_weight(
# pretrained_weights_path='s3://zlf-rubbish-data/weights/resnet101-5d3b4d8f.pth',
# copy_to_local_root='/cache/weight'),
# )
train_valid(in_channels=3, out_channels=8, net_name="deeplabv3", lr=0.001,
train_csv_path="seed-project/data_list/train.csv",
load_train_data=copy_dataset(copy_to_local_root="/cache/datasets",
source_data_path='s3://zlf-rubbish-data/datasets/original.zip'),
valid_csv_path="seed-project/data_list/valid.csv",
load_valid_data=copy_dataset(copy_to_local_root="/cache/datasets",
source_data_path='s3://zlf-rubbish-data/datasets/original.zip'),
batch_size=16, resize=(512, 512), crop_offset=(730, 0),
epoch_begin=0, epoch_num=5,
num_classes=8,
save_model=save_model(local_root="/cache/model", copy_root="s3://zlf-rubbish-data/outputs/"),
loss_type=LossType.dice_loss,
load_resnet_weight=load_weight(
pretrained_weights_path='s3://zlf-rubbish-data/weights/resnet101-5d3b4d8f.pth',
copy_to_local_root='/cache/weight'),
)