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

Why performance highly degraded when perform model.eval()? #79

Open
qimw opened this issue Apr 12, 2020 · 3 comments
Open

Why performance highly degraded when perform model.eval()? #79

qimw opened this issue Apr 12, 2020 · 3 comments

Comments

@qimw
Copy link

qimw commented Apr 12, 2020

I am adapting from light dataset to a darker one. When I am running test on the source domain, I found that the performance is highly degraded if performing model.eval(). But this doesn't appear on the target domain. It is quiet wired. And my pytorch version is 1.0

@qimw
Copy link
Author

qimw commented Apr 12, 2020

I found that the bns are set requires_grad = False, but it will still update the running_mean and running_var. So what's the meaning of doing this?

@wasidennis
Copy link
Owner

Seems that the gamma and beta in batchnorm are still updated (we also found this before), but we cannot control it. For the degraded performance on source, it is natural compared to the model without target domain alignment. However, it should not produce something super bad as there is still a supervised loss on source.

@qimw
Copy link
Author

qimw commented Apr 21, 2020

No, the result is super bad. Maybe this is due to the large domain gap. The last iter we will train model on target domain. So the batchnorm parameters(running_mean, running_var) will adapt to the target domain at the same time. When we are testing on the source domain, batchnorm parameters don't match with this domain. As a result, performance will drop.

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