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

error rate compute in demo.py #12

Closed
ghost opened this issue Aug 23, 2017 · 4 comments
Closed

error rate compute in demo.py #12

ghost opened this issue Aug 23, 2017 · 4 comments

Comments

@ghost
Copy link

ghost commented Aug 23, 2017

Hi, thanks for this efficient densenet code.

But I found a probable mistake in demo.py at line 112:
error = 1 - torch.eq(predictions_var, target_var).float().mean()
it might have to be corrected to:
error = 1 - torch.eq(predictions_var.view(-1), target_var).float().mean()

Because the size of predictions_var and target_var are (train_size, 1) and (train_size, ), torch.eq(...) will return a train_size * train_size matrix, and its entries are almost 0 (only 1 at diagonal). Then the error rate will not able to decrease.

@taineleau-zz
Copy link
Collaborator

Hi, are you using PyTorch 0.2?

@ghost
Copy link
Author

ghost commented Aug 26, 2017

My PyTorch version is 0.2.0+925208a, I installing it from source.

@mosttl
Copy link

mosttl commented Sep 1, 2017

I met the same problem with the latest PyTorch (v0.2.0) installed, and also figured out the same solution.

@taineleau-zz
Copy link
Collaborator

taineleau-zz commented Sep 1, 2017

The code currently is based on PyTorch v0.1.12. We will release the code for the latest PyTorch version soon. Please kindly use v0.1.12 for now. Thanks!

merged to #11

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