mirror of https://github.com/WongKinYiu/yolov7.git
Fix np, uda dev issue (#1272)
Limit numpy version to avoid issue with tensorboard, conv np.int to just int, fix mismatched device issuecuda dev issuepull/1317/head
parent
8e9f0b731d
commit
557e3837af
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Base ----------------------------------------
|
# Base ----------------------------------------
|
||||||
matplotlib>=3.2.2
|
matplotlib>=3.2.2
|
||||||
numpy>=1.18.5
|
numpy>=1.18.5,<1.24.0
|
||||||
opencv-python>=4.1.1
|
opencv-python>=4.1.1
|
||||||
Pillow>=7.1.2
|
Pillow>=7.1.2
|
||||||
PyYAML>=5.3.1
|
PyYAML>=5.3.1
|
||||||
|
|
|
@ -415,7 +415,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
|
||||||
x[:, 0] = 0
|
x[:, 0] = 0
|
||||||
|
|
||||||
n = len(shapes) # number of images
|
n = len(shapes) # number of images
|
||||||
bi = np.floor(np.arange(n) / batch_size).astype(np.int) # batch index
|
bi = np.floor(np.arange(n) / batch_size).astype(int) # batch index
|
||||||
nb = bi[-1] + 1 # number of batches
|
nb = bi[-1] + 1 # number of batches
|
||||||
self.batch = bi # batch index of image
|
self.batch = bi # batch index of image
|
||||||
self.n = n
|
self.n = n
|
||||||
|
@ -443,7 +443,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
|
||||||
elif mini > 1:
|
elif mini > 1:
|
||||||
shapes[i] = [1, 1 / mini]
|
shapes[i] = [1, 1 / mini]
|
||||||
|
|
||||||
self.batch_shapes = np.ceil(np.array(shapes) * img_size / stride + pad).astype(np.int) * stride
|
self.batch_shapes = np.ceil(np.array(shapes) * img_size / stride + pad).astype(int) * stride
|
||||||
|
|
||||||
# Cache images into memory for faster training (WARNING: large datasets may exceed system RAM)
|
# Cache images into memory for faster training (WARNING: large datasets may exceed system RAM)
|
||||||
self.imgs = [None] * n
|
self.imgs = [None] * n
|
||||||
|
|
|
@ -739,7 +739,7 @@ class ComputeLossOTA:
|
||||||
+ 3.0 * pair_wise_iou_loss
|
+ 3.0 * pair_wise_iou_loss
|
||||||
)
|
)
|
||||||
|
|
||||||
matching_matrix = torch.zeros_like(cost)
|
matching_matrix = torch.zeros_like(cost, device="cpu")
|
||||||
|
|
||||||
for gt_idx in range(num_gt):
|
for gt_idx in range(num_gt):
|
||||||
_, pos_idx = torch.topk(
|
_, pos_idx = torch.topk(
|
||||||
|
|
Loading…
Reference in New Issue