wasidennis / AdaptSegNet

Learning to Adapt Structured Output Space for Semantic Segmentation, CVPR 2018 (spotlight)
847 stars 203 forks source link

question about load pretrained DeepLabVGG #94

Closed Lufei-github closed 3 years ago

Lufei-github commented 3 years ago

@wasidennis @ alphjheon Sorry to bother you first. I have a quetion!

I download the pretrained DeepLabVGG model from this link: https://www.dropbox.com/s/r8dx8xuqpsr3do3/vgg16-00b39a1b-updated.pth?dl=0.

Then I modify the code like below: model = DeeplabVGG(num_classes=args.num_classes, vgg16_caffe_path=args.restore_from, pretrained=True) if args.restore_from[:4] == 'http' : saved_state_dict = model_zoo.load_url(args.restore_from) else: saved_state_dict = torch.load(args.restore_from) And I modify the RESTORE_FROM = https://www.dropbox.com/s/r8dx8xuqpsr3do3/vgg16-00b39a1b-updated.pth?dl=0, then RESTORE_FROM = https://www.dropbox.com/s/r8dx8xuqpsr3do3/vgg16-00b39a1b-updated.pth

But it's doesn't work. And says: Traceback (most recent call last): File "train_single_dsd.py", line 434, in main() File "train_single_dsd.py", line 188, in main model = DeeplabVGG(num_classes=args.num_classes, vgg16_caffe_path=args.restore_from, pretrained=True) File "/home/zgm/Lufei/AdaptCcd/AdaptSegNet/model/deeplab_vgg.py", line 29, in init vgg.load_state_dict(torch.load(vgg16_caffe_path)) File "/home/zgm/anaconda3/envs/AdaptSegNet/lib/python3.6/site-packages/torch/serialization.py", line 382, in load f = open(f, 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'https://www.dropbox.com/s/r8dx8xuqpsr3do3/vgg16-00b39a1b-updated.pth?dl=0' or 'https://www.dropbox.com/s/r8dx8xuqpsr3do3/vgg16-00b39a1b-updated.pth'

So can you give me some advice? Thanks so much!!!