pytorch-lesson-zh icon indicating copy to clipboard operation
pytorch-lesson-zh copied to clipboard

AlexNet.ipynb FC Layer Param number Wrong

Open SJLNNU opened this issue 5 years ago • 2 comments

hi, When creating Class AlexNet, self.fc goes like this:


self.fc = nn.Sequential( nn.Linear(11256, 4096), nn.ReLU(inplace=True), nn.Dropout(0.5), nn.Linear(4096, 4096), nn.ReLU(inplace=True), nn.Dropout(0.5), nn.Linear(4096, n_class) # AlexNet上面是1000 ...如果测试的话用MNIST则可以使用10 )


but the first nn.Linear should be nn.Linear(66256,4096). When pytorch update to 1.0 some of the code in the project need to be changed like tensor.data[0] . THX.

SJLNNU avatar Apr 10 '19 07:04 SJLNNU

Sorry the first nn.Linear should be 11256 ,becouse of the CIFAR10 resize of 96

SJLNNU avatar Apr 10 '19 08:04 SJLNNU

yeah, some of the code were out of date. I will take some time to update them. THX ~

LianHaiMiao avatar Apr 10 '19 11:04 LianHaiMiao