mirror of https://github.com/open-mmlab/mmyolo.git
Fix the device inconsistency error in yolov7 training (#397)
* [FIX] Indices should be either on cpu or on the same device as the indexed tensor * fix lint error * use new_full instead of simple torch.ones * fix lint error * fix type error * use existed tensor to create new_full tensor Co-authored-by: zhubochao <zhubochao@zhubochaodeMacBook-Pro.local>pull/362/head
parent
46e7f6a477
commit
6c5acd238c
|
@ -227,7 +227,8 @@ class BatchYOLOv7Assigner(nn.Module):
|
|||
_mlvl_priors.append(priors)
|
||||
|
||||
_from_which_layer.append(
|
||||
torch.ones(size=(_mlvl_positive_info.shape[0], )) * i)
|
||||
_mlvl_positive_info.new_full(
|
||||
size=(_mlvl_positive_info.shape[0], ), fill_value=i))
|
||||
|
||||
# (n,85)
|
||||
level_batch_idx, prior_ind, \
|
||||
|
|
Loading…
Reference in New Issue