Fix float zeros format (#5491)

* Fix float zeros format

* 255 to integer
This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-11-03 23:36:53 +01:00
1 parent 8a803f36d3
commit 5866646cc8
16 files changed
+36 -36

No files matched your search

+4 -4
View File
@@ -246,9 +246,9 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
# Model parameters
nl = de_parallel(model).model[-1].nl # number of detection layers (to scale hyps)
hyp['box'] *= 3. / nl # scale to layers
hyp['cls'] *= nc / 80. * 3. / nl # scale to classes and layers
hyp['obj'] *= (imgsz / 640) ** 2 * 3. / nl # scale to image size and layers
hyp['box'] *= 3 / nl # scale to layers
hyp['cls'] *= nc / 80 * 3 / nl # scale to classes and layers
hyp['obj'] *= (imgsz / 640) ** 2 * 3 / nl # scale to image size and layers
hyp['label_smoothing'] = opt.label_smoothing
model.nc = nc # attach number of classes to model
model.hyp = hyp # attach hyperparameters to model
@@ -293,7 +293,7 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
optimizer.zero_grad()
for i, (imgs, targets, paths, _) in pbar: # batch -------------------------------------------------------------
ni = i + nb * epoch # number integrated batches (since train start)
imgs = imgs.to(device, non_blocking=True).float() / 255.0 # uint8 to float32, 0-255 to 0.0-1.0
imgs = imgs.to(device, non_blocking=True).float() / 255 # uint8 to float32, 0-255 to 0.0-1.0
# Warmup
if ni <= nw: