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

Replace view with reshape? #7

Open
tyler-utah opened this issue Nov 24, 2022 · 0 comments
Open

Replace view with reshape? #7

tyler-utah opened this issue Nov 24, 2022 · 0 comments

Comments

@tyler-utah
Copy link

Hi, we were running condensa on the CIFAR-10 and Alexnet example. Our versions are:

Python version: 3.8.5
Pytorch version: 1.12.1+cu102

we get the following error at condensa/util.py line 112

correct_k = correct[:k].view(-1).float().sum(0, keepdim=True)
RuntimeError: view size is not compatible with input tensor's size and stride (at least one \
dimension spans across two contiguous subspaces). Use .reshape(...) instead.

We tried just replacing view with reshape and things seem to work okay. But I don't know Pytorch enough to know if this is the correct thing to do.

Thanks!

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

1 participant