Ahh. I saw your edits though, thanks
Here’s code for a network known to do well on CIFAR, although they don’t include a pretrained model file https://github.com/xternalz/WideResNet-pytorch
Oh okay! I’ll see if I can train it. Thanks again!
Didn’t we have a repo of links to PyTorch implementation of various papers? (Or I’m confusing that with Chainer’s similar repo :S)
There’s this https://github.com/ritchieng/the-incredible-pytorch (Chainer keeps a semi-official one, but it probably makes more sense to leave it to the community)
Hmm yeah I guess. Thanks for the repo
Hi, I uploaded resnet-v3 models in https://github.com/prlz77/ResNeXt.pytorch, however they are not the full-sized ones, which you can train yourself with this code too
Sorry for the dumb question, but how do you load a .pytorch file. Is it the same extension as .pth?
This doesn’t seem to work:
net = torch.load(‘model.pytorch’)
I think this is the way: http://stackoverflow.com/questions/42703500/best-way-to-save-a-trained-model-in-pytroch
What would be TheModelClass for your model?
Did you manage to train/load the model successfully? I managed to train it, but I am having a sizes do not match error, when I am trying to load it. I am trying to load it with the following code:
model = wrn.WideResNet(layers, 10)
model = model.cuda()
checkpoint = torch.load(‘runs/WideResNet-28-10/checkpoint.pth.tar’)
RuntimeError: sizes do not match at /data/users/soumith/miniconda2/conda-bld/pytorch-0.1.7_1485444530918/work/torch/lib/THC/THCTensorCopy.cu:31
@Ismail_Elezi Did you solve your problem? I also got the same when I tried to resume to train a network.
Yes, I managed to load ResNets that I trained on CIFAR datasets. The code for that is:
model = wrn.WideResNet(depth=number_of_layers, num_classes=100, widen_factor=4)
checkpoint = torch.load(‘runs/WideResNet-28-10/cifar_10.pth.tar’)
model = model.cuda()
The parameters for the model and for the net you are loading should agree.
For what is worth, the accuracy I got was:
with these hyperparameters:
layers: 40 convs
learning rate: 0.1
momentum: nesterov with 0.9 param
regularization: Tikhonov with 5e-4 param
batch size: 128
number of epochs: 200
Would be interesting to see what happens if I use some more advanced optimizer like Adam.
Anyway, in case you don’t have time to train them, I can upload the models today, during the afternoon.
I just read your question! Nice to know you managed
Then on which dataset all the models are pretrained?
they’re all pre-trained on Imagenet-12
Thank you very much. Its helpfulu
Here is the link to repo that has pretrained ResNets for CIFAR10, and this models are lean-resnets discussed in original paper. If you directly apply ResNets from torchvision to train your own net, you’ll get something that is not in original paper, because torchvision’s nets are for ImageNet, not CIFAR10
I also searched for pretrained Pytorch models on CIFAR-10 but I could not find any repo that share weights so I made one:
Thanks for that question! It is really confusing first if one is new to ML and tries to find an explanation on which datasets pretrained models are fit on.