Ayush Chaurasia commited on
Commit
11e7c7b
1 Parent(s): 3a72d4a

W&B: Don't log models in evolve operation (#4611)

Browse files
utils/loggers/__init__.py CHANGED
@@ -138,7 +138,11 @@ class Loggers():
138
  if self.wandb:
139
  self.wandb.log({"Results": [wandb.Image(str(f), caption=f.name) for f in files]})
140
  # Calling wandb.log. TODO: Refactor this into WandbLogger.log_model
141
- wandb.log_artifact(str(best if best.exists() else last), type='model',
142
- name='run_' + self.wandb.wandb_run.id + '_model',
143
- aliases=['latest', 'best', 'stripped'])
144
- self.wandb.finish_run()
 
 
 
 
 
138
  if self.wandb:
139
  self.wandb.log({"Results": [wandb.Image(str(f), caption=f.name) for f in files]})
140
  # Calling wandb.log. TODO: Refactor this into WandbLogger.log_model
141
+ if not self.opt.evolve:
142
+ wandb.log_artifact(str(best if best.exists() else last), type='model',
143
+ name='run_' + self.wandb.wandb_run.id + '_model',
144
+ aliases=['latest', 'best', 'stripped'])
145
+ self.wandb.finish_run()
146
+ else:
147
+ self.wandb.finish_run()
148
+ self.wandb = WandbLogger(self.opt)
utils/loggers/wandb/wandb_utils.py CHANGED
@@ -112,7 +112,7 @@ class WandbLogger():
112
  https://docs.wandb.com/guides/integrations/yolov5
113
  """
114
 
115
- def __init__(self, opt, run_id, job_type='Training'):
116
  """
117
  - Initialize WandbLogger instance
118
  - Upload dataset if opt.upload_dataset is True
 
112
  https://docs.wandb.com/guides/integrations/yolov5
113
  """
114
 
115
+ def __init__(self, opt, run_id=None, job_type='Training'):
116
  """
117
  - Initialize WandbLogger instance
118
  - Upload dataset if opt.upload_dataset is True