Use trainer.amp to determine FP16 validation (#16333)
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
80c286736b
commit
225e6e2b25
1 changed files with 1 additions and 1 deletions
|
|
@ -111,7 +111,7 @@ class BaseValidator:
|
|||
self.device = trainer.device
|
||||
self.data = trainer.data
|
||||
# force FP16 val during training
|
||||
self.args.half = self.device.type != "cpu" and self.args.amp
|
||||
self.args.half = self.device.type != "cpu" and trainer.amp
|
||||
model = trainer.ema.ema or trainer.model
|
||||
model = model.half() if self.args.half else model.float()
|
||||
# self.model = model
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue