Eric-mingjie / network-slimming

Network Slimming (Pytorch) (ICCV 2017)
MIT License
907 stars 214 forks source link

Minor Bugs caused by old version #75

Open planemanner opened 2 years ago

planemanner commented 2 years ago

This issue is for pytorch 1.7+ version user

Line 148, 160 in main.py script

Line 148

100. * batch_idx / len(train_loader), loss.data[0]))

Line 160

test_loss += F.cross_entropy(output, target, size_average=False).data[0]

The end of those code lines should be revised as following .data[0] -> .item()

I know most of guys using this repo can fix easily, but someone would be confused. So I leave above minor tip in this issue.