@金天 刚刚试了一下还是不行,报错情况如下。这是训练集的问题吗?
Failed to generate graph for model: index 0 is out of bounds for axis 0 with size 0. Note that there's an outstanding issue with scopes being addressed here: https://github.com/pytorch/pytorch/pull/12400
Failed to generate graph for model: index 0 is out of bounds for axis 0 with size 0. Note that there's an outstanding issue with scopes being addressed here: https://github.com/pytorch/pytorch/pull/12400
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
<ipython-input-8-5da03e316ffe> in <module>()
----> 1 trainer.train(scheds=scheds)
D:\pythonwork\DeOldify\fasterai\training.py in train(self, scheds)
175
176 self._get_inner_module(self.netG).freeze_to(sched.gen_freeze_to)
--> 177 self.critic_sched.on_train_begin()
178 self.gen_sched.on_train_begin()
179
D:\pythonwork\DeOldify\fastai\sgdr.py in on_train_begin(self)
303 def on_train_begin(self):
304 self.cycle_iter,self.cycle_count=0,0
--> 305 super().on_train_begin()
306
307 def calc_lr(self, init_lrs):
D:\pythonwork\DeOldify\fastai\sgdr.py in on_train_begin(self)
135 def on_train_begin(self):
136 super().on_train_begin()
--> 137 self.update_lr()
138 if self.record_mom:
139 self.update_mom()
D:\pythonwork\DeOldify\fastai\sgdr.py in update_lr(self)
147
148 def update_lr(self):
--> 149 new_lrs = self.calc_lr(self.init_lrs)
150 self.layer_opt.set_lrs(new_lrs)
151
D:\pythonwork\DeOldify\fastai\sgdr.py in calc_lr(self, init_lrs)
313 res = init_lrs * (1 + pct*(self.div-1)) / self.div
314 else:
--> 315 pct = self.cycle_iter/self.cycle_nb
316 res = init_lrs * (1 + pct*(self.div-1)) / self.div
317 self.cycle_iter += 1
ZeroDivisionError: division by zero