You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "main_imagenet.py", line 198, in <module>
print('Quantized accuracy before brecq: {}'.format(validate_model(test_loader, qnn)))
File "/home/xxxx/anaconda3/envs/torch/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "main_imagenet.py", line 108, in validate_model
acc1, acc5 = accuracy(output, target, topk=(1, 5))
File "main_imagenet.py", line 77, 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.
So suggest replacing .view with .reshape in accuracy() function.
The text was updated successfully, but these errors were encountered:
Got an error:
So suggest replacing
.view
with.reshape
inaccuracy()
function.The text was updated successfully, but these errors were encountered: