fix cpu-only training CUDA error (#369)
This commit is contained in:
parent
6bacefff5c
commit
cc42a206ef
2
train.py
2
train.py
@ -68,7 +68,7 @@ def train(hyp, opt, device, tb_writer=None):
|
|||||||
loggers = {'wandb': None} # loggers dict
|
loggers = {'wandb': None} # loggers dict
|
||||||
if rank in [-1, 0]:
|
if rank in [-1, 0]:
|
||||||
opt.hyp = hyp # add hyperparameters
|
opt.hyp = hyp # add hyperparameters
|
||||||
run_id = torch.load(weights).get('wandb_id') if weights.endswith('.pt') and os.path.isfile(weights) else None
|
run_id = torch.load(weights, map_location=device).get('wandb_id') if weights.endswith('.pt') and os.path.isfile(weights) else None
|
||||||
wandb_logger = WandbLogger(opt, Path(opt.save_dir).stem, run_id, data_dict)
|
wandb_logger = WandbLogger(opt, Path(opt.save_dir).stem, run_id, data_dict)
|
||||||
loggers['wandb'] = wandb_logger.wandb
|
loggers['wandb'] = wandb_logger.wandb
|
||||||
data_dict = wandb_logger.data_dict
|
data_dict = wandb_logger.data_dict
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user