d-li14 / mobilenetv3.pytorch

74.3% MobileNetV3-Large and 67.2% MobileNetV3-Small model on ImageNet

Home Page:https://arxiv.org/abs/1905.02244

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

torch 2.0.1, met some problem in function `accuracy()` and solved

wplf opened this issue · comments

line 18
the function view() has some problem when calculating topk=5
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces).

the instruction may solve this problem
correct_k = correct[:k].view(-1).float().sum(0) changed to correct_k = correct[:k].float().sum()

sorry, this issues is for mobilenetv2