AdderNetCuda icon indicating copy to clipboard operation
AdderNetCuda copied to clipboard

Issue while running train.py

Open AnjanaNiranjan opened this issue 5 years ago • 1 comments

I followed the instructions in the readme file to run the code and getting the following error. Am I doing something wrong?

File "/content/utils.py", line 39, in accuracy 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.

I have not made any changes to the code.

AnjanaNiranjan avatar Nov 08 '20 01:11 AnjanaNiranjan

This problem is very common. You could google .contiguous() and put .contiguous before .view(-1)

dentionY avatar Feb 17 '23 08:02 dentionY