Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net.train() again in demo_MNIST_train.py file #48

Open
Dylee-y opened this issue Aug 22, 2022 · 2 comments
Open

net.train() again in demo_MNIST_train.py file #48

Dylee-y opened this issue Aug 22, 2022 · 2 comments

Comments

@Dylee-y
Copy link

Dylee-y commented Aug 22, 2022

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?

@AlexHex7
Copy link
Owner

@Dylee-y Hi.

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

@Dylee-y
Copy link
Author

Dylee-y commented Aug 23, 2022

Ohh thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants