deep-image-prior icon indicating copy to clipboard operation
deep-image-prior copied to clipboard

Error when loading pretrained vgg and alexnet

Open DmitryUlyanov opened this issue 7 years ago • 3 comments
trafficstars

When loading pretrained vgg and alexnet in python 3.6:

'ascii' codec can't decode byte 0xc3 in position 875: ordinal not in range(128)

DmitryUlyanov avatar Dec 04 '17 13:12 DmitryUlyanov

How did you load pretrained vgg or alexnet?

I tried to load vgg16 for preceptual loss in SR :). And it works well. Here is my method:

# python2.7
import torchvision.models as models
vgg = models.vgg16(pretrained=True).features # except the classification layers

Although my python version is 2.7, but i think it's probably ok in 3. You may look here or here for some ideas.

babaozhouy5 avatar Dec 04 '17 15:12 babaozhouy5

I've converted VGG-19 and Alexnet from Caffe to Torch7 and then to Pytorch. Did so because other papers use these nets pretrained with Caffe.

Models from pytorch's torchvision are different to the reference models, yet it is ok to use them if your aim is not to compare to other works.

DmitryUlyanov avatar Dec 05 '17 10:12 DmitryUlyanov

Hi, have you made the code snippet converting caffe to pytorch available somewhere? thanks

tumble-weed avatar Oct 31 '18 01:10 tumble-weed