Closed Smallwhite999 closed 3 years ago
Hi, That error may come from the wrong assignment for the argparse "--method". Please check it again (You need to put it as "--method pred" or "--method recon"). Thank you.
How did you finally solve this problem?
Did you solve it?
I followed the steps in the readme and reported the error as follows: /home/anaconda3/envs/MNAD/lib/python3.6/site-packages/torch/optim/lr_scheduler.py:134: UserWarning: Detected call of
print('Loss: Prediction {:.6f}/ Compactness {:.6f}/ Separateness {:.6f}'.format(loss_pixel.item(), compactness_loss.item(), separateness_loss.item()))
NameError: name 'loss_pixel' is not defined
lr_scheduler.step()
beforeoptimizer.step()
. In PyTorch 1.1.0 and later, you should call them in the opposite order:optimizer.step()
beforelr_scheduler.step()
. Failure to do this will result in PyTorch skipping the first value of the learning rate schedule. See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate "https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate", UserWarning) Traceback (most recent call last): File "Train.py", line 148, inHow to solve it? Thank you