Non-local_pytorch icon indicating copy to clipboard operation
Non-local_pytorch copied to clipboard

net.train() again in demo_MNIST_train.py file

Open Dylee-y opened this issue 2 years ago • 2 comments

Hi, I started to learn pytorch a few months ago, so I might be questioning basic stuff.

in [Non-local_pytorch/demo_MNIST_train.py](url) file, there was net.train() in the 50th line, within the training loop. after the testing loop, net.train() is called once more in the 70th line. I know that switching the network into training mode after the testing loop is important, but why is net.train() in the 70th line necessary when it would be called at the beginning of the training loop anyways?

Dylee-y avatar Aug 22 '22 11:08 Dylee-y

@Dylee-y Hi.

I think that net.train() in the 70th line is unnecessary. Thanks for pointing it out. And I'll delete it.

AlexHex7 avatar Aug 23 '22 07:08 AlexHex7

Ohh thank you very much!

Dylee-y avatar Aug 23 '22 07:08 Dylee-y