Skip to content

Commit

Permalink
discard distributed
Browse files Browse the repository at this point in the history
  • Loading branch information
CoinCheung committed Jun 25, 2022
1 parent 628ebda commit 99951a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/get_dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@



def get_data_loader(cfg, mode='train', distributed=True):
def get_data_loader(cfg, mode='train'):
if mode == 'train':
trans_func = T.TransformationTrain(cfg.scales, cfg.cropsize)
batchsize = cfg.ims_per_gpu
Expand All @@ -28,7 +28,7 @@ def get_data_loader(cfg, mode='train', distributed=True):

ds = eval(cfg.dataset)(cfg.im_root, annpath, trans_func=trans_func, mode=mode)

if distributed:
if dist.is_initialized():
assert dist.is_available(), "dist should be initialzed"
if mode == 'train':
assert not cfg.max_iter is None
Expand Down
3 changes: 1 addition & 2 deletions tools/train_amp.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,9 @@ def set_meters():

def train():
logger = logging.getLogger()
is_dist = dist.is_initialized()

## dataset
dl = get_data_loader(cfg, mode='train', distributed=is_dist)
dl = get_data_loader(cfg, mode='train')

## model
net, criteria_pre, criteria_aux = set_model(dl.dataset.lb_ignore)
Expand Down

0 comments on commit 99951a1

Please sign in to comment.