pytorch-classification icon indicating copy to clipboard operation
pytorch-classification copied to clipboard

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.

Open happy20200 opened this issue 3 years ago • 1 comments

8ed87865718db632e4eff3e03069085

happy20200 avatar Jul 22 '22 03:07 happy20200

Hi, about this issue, you can with

correct_k = correct[:k].reshape(-1).float().sum(0)

to replaced

correct_k = correct[:k].view(-1).float().sum(0)

in utils/eval.py

z872845991 avatar Jan 10 '24 08:01 z872845991