ultralytics 8.1.9 replace .size(0) with .shape[0] (#7957)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
66b32bb4dd
commit
70d4a3752e
15 changed files with 42 additions and 22 deletions
|
|
@ -400,7 +400,7 @@ class BaseTrainer:
|
|||
|
||||
# Log
|
||||
mem = f"{torch.cuda.memory_reserved() / 1E9 if torch.cuda.is_available() else 0:.3g}G" # (GB)
|
||||
loss_len = self.tloss.shape[0] if len(self.tloss.size()) else 1
|
||||
loss_len = self.tloss.shape[0] if len(self.tloss.shape) else 1
|
||||
losses = self.tloss if loss_len > 1 else torch.unsqueeze(self.tloss, 0)
|
||||
if RANK in (-1, 0):
|
||||
pbar.set_description(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue