Skip to content

Commit

Permalink
fix cpu-only training CUDA error (WongKinYiu#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhoshbin72 authored Jul 30, 2022
1 parent 6baceff commit cc42a20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def train(hyp, opt, device, tb_writer=None):
loggers = {'wandb': None} # loggers dict
if rank in [-1, 0]:
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)
loggers['wandb'] = wandb_logger.wandb
data_dict = wandb_logger.data_dict
Expand Down

0 comments on commit cc42a20

Please sign in to comment.