FixMatch-pytorch icon indicating copy to clipboard operation
FixMatch-pytorch copied to clipboard

train failed when EMA mode is off

Open frozenzo opened this issue 3 years ago • 5 comments

I found that this is because the model.train() did not open again when evaluation ends. solution: just move mode.train() to the epoch loop:

  • model.train() for epoch in range(args.start_epoch, args.epochs):

->

for epoch in range(args.start_epoch, args.epochs):

  •    model.train()
    

frozenzo avatar Jun 19 '21 12:06 frozenzo

dear author, could you kindly show results that did not use EMA for testing?

frozenzo avatar Jun 19 '21 12:06 frozenzo

same question here. Considering the long training time, I wanna know did you finish the training for the fixed version?

DingYuan0118 avatar Dec 06 '21 02:12 DingYuan0118

It's late, but I'll check.

kekmodel avatar Feb 09 '22 10:02 kekmodel

I met exactly the same thing: on the second epoch, the loss becomes nan without modification when EMA is off.

TonyLianLong avatar May 02 '22 20:05 TonyLianLong

yes, I met the same thing too. If test the model, the loss will be nan when ema is closed.However, the loss is normal without test step.

dahuaxiya avatar Aug 18 '23 02:08 dahuaxiya