diff --git a/README.md b/README.md index 9f1fd365..66ba387a 100755 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ GPUs | `batch_size` | images/sec | epoch time | epoch cost K80 | 64 (32x2) | 11 | 175 min | $0.58 T4 | 64 (32x2) | 40 | 49 min | $0.29 T4 x2 | 64 (64x1) | 61 | 32 min | $0.36 -V100 | 64 (32x2) | 115 | 17 min | $0.24 +V100 | 64 (32x2) | 122 | 16 min | $0.23 V100 x2 | 64 (64x1) | 150 | 13 min | $0.36 2080Ti | 64 (32x2) | 81 | 24 min | - 2080Ti x2 | 64 (64x1) | 140 | 14 min | - diff --git a/test.py b/test.py index 9ffa82e2..f1145f30 100644 --- a/test.py +++ b/test.py @@ -64,8 +64,8 @@ def test(cfg, loss = torch.zeros(3) jdict, stats, ap, ap_class = [], [], [], [] for batch_i, (imgs, targets, paths, shapes) in enumerate(tqdm(dataloader, desc=s)): + imgs = imgs.to(device).float() / 255.0 # uint8 to float32, 0 - 255 to 0.0 - 1.0 targets = targets.to(device) - imgs = imgs.to(device) _, _, height, width = imgs.shape # batch size, channels, height, width # Plot images with bounding boxes diff --git a/train.py b/train.py index ff02e154..0c4b56bc 100644 --- a/train.py +++ b/train.py @@ -251,7 +251,7 @@ def train(): pbar = tqdm(enumerate(dataloader), total=nb) # progress bar for i, (imgs, targets, paths, _) in pbar: # batch ------------------------------------------------------------- ni = i + nb * epoch # number integrated batches (since train start) - imgs = imgs.to(device) + imgs = imgs.to(device).float() / 255.0 # uint8 to float32, 0 - 255 to 0.0 - 1.0 targets = targets.to(device) # Multi-Scale training diff --git a/utils/datasets.py b/utils/datasets.py index 18e25a15..e5daa630 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -487,8 +487,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing # Convert img = img[:, :, ::-1].transpose(2, 0, 1) # BGR to RGB, to 3x416x416 - img = np.ascontiguousarray(img, dtype=np.float32) # uint8 to float32 - img /= 255.0 # 0 - 255 to 0.0 - 1.0 + img = np.ascontiguousarray(img) return torch.from_numpy(img), labels_out, img_path, ((h, w), (ratio, pad))