Pytorch to IR conversion: 'Collections.OrderedDict'a object has no attribute
Platform (like ubuntu 16.04/win10): Ubuntu 18.04
Python version: Python 3.6
Source framework with version : Pytorch 0.4.0
Pre-trained model path (webpath or webdisk path): https://download.pytorch.org/models/resnet101-5d3b4d8f.pth
I have gotten all the required versions and packages given in : https://github.com/microsoft/MMdnn/blob/master/requirements/linux-py3.txt
In the FAQ it says that its because I have a model which has just the weights. But I am using the pre-trained model so there shouldn't be such an issue right ?
Anything I might be missing ?
Hi @Hasan6979 , models downloaded directly from torchvision only have weights (you can check it easily with netron). An extra precedure of load and save is required, which we have implemented in mmdownload command.
So try mmdownload -f pytorch -n resnet101 -o ./
Hi @XiaoXYe The problem is with using mmdownload with me is that where I am working, they have blocked wget so mmdownload fails. What steps can I do to have the architecture with the weights ? The load and save step that you are talking about.
Hi @Hasan6979 , This code will help you
import torch
import torchvision.models as models
net = models.resnet101(pretrained=False)
net.load_state_dict(torch.load('resnet101.pth'))
torch.save(net, 'imagenet_resnet101.pth')