Skip to content

Commit

Permalink
changed enabled parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Bala-Vignesh-Reddy committed Jan 5, 2025
1 parent 77180d7 commit df838a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import yaml
from torch.optim import lr_scheduler
from tqdm import tqdm
from torch.cuda import amp

FILE = Path(__file__).resolve()
ROOT = FILE.parents[0] # YOLOv5 root directory
Expand Down Expand Up @@ -352,7 +353,7 @@ def lf(x):
maps = np.zeros(nc) # mAP per class
results = (0, 0, 0, 0, 0, 0, 0) # P, R, mAP@.5, mAP@.5-.95, val_loss(box, obj, cls)
scheduler.last_epoch = start_epoch - 1 # do not move
scaler = torch.amp.GradScaler(enabled=amp)
scaler = amp.GradScaler(enabled=cuda)
stopper, stop = EarlyStopping(patience=opt.patience), False
compute_loss = ComputeLoss(model) # init loss class
callbacks.run("on_train_start")
Expand Down

0 comments on commit df838a4

Please sign in to comment.