Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-trained shufflenetv2_x1.5 and shufflenetv2_x2.0 raise "...not supported as of now". #3257

Closed
gallardorafael opened this issue Jan 16, 2021 · 3 comments · Fixed by #5906
Closed
Assignees

Comments

@gallardorafael
Copy link

🐛 Bug

Pre-trained models of shufflenetv2_x1.5 and shufflenetv2_x2.0 raise the following NotImplementedError: pretrained {} is not supported as of now. Important: pre-trained models of shufflenet_v2_x0_5 and shufflenet_v2_x1_0 are working perfectly.

To Reproduce

Steps to reproduce the behavior:

  1. from torchvision import models
  2. model = models.shufflenet_v2_x1_5(pretrained=pretrained)
  3. model = models.shufflenet_v2_x2_0(pretrained=pretrained)
  4. Raises the following:
  NotImplementedError                       Traceback (most recent call last)
  <ipython-input-15-788c60a16542> in <module>
        1 # Build and train your network
        2 # Transfer Learning
  ----> 3 model = models.shufflenet_v2_x1_5(pretrained=pretrained)
  
  ~/venvs/pytorch_gpu/lib/python3.8/site-packages/torchvision/models/shufflenetv2.py in shufflenet_v2_x1_5(pretrained, progress, **kwargs)
      191         progress (bool): If True, displays a progress bar of the download to stderr
      192     """
  --> 193     return _shufflenetv2('shufflenetv2_x1.5', pretrained, progress,
      194                          [4, 8, 4], [24, 176, 352, 704, 1024], **kwargs)
      195 
  
  ~/venvs/pytorch_gpu/lib/python3.8/site-packages/torchvision/models/shufflenetv2.py in _shufflenetv2(arch, pretrained, progress, *args, **kwargs)
      145         model_url = model_urls[arch]
      146         if model_url is None:
  --> 147             raise NotImplementedError('pretrained {} is not supported as of now'.format(arch))
      148         else:
      149             state_dict = load_state_dict_from_url(model_url, progress=progress)
  
  NotImplementedError: pretrained shufflenetv2_x1.5 is not supported as of now

Expected behavior

Get the pre-trained model of Shufflenet_v2_x1_5 and shufflenet_v2_x2.0.

Environment

  • PyTorch version: 1.5.1
  • Is debug build: False
  • CUDA used to build PyTorch: 10.2
  • ROCM used to build PyTorch: N/A
  • OS: Ubuntu 20.04.1 LTS (x86_64)
  • GCC version: (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
  • Clang version: Could not collect
  • CMake version: Could not collect
  • Python version: 3.8 (64-bit runtime)
  • Is CUDA available: True
  • CUDA runtime version: Could not collect
  • GPU models and configuration: GPU 0: GeForce GTX 1660 Ti with Max-Q Design
  • Nvidia driver version: 450.102.04
  • cuDNN version: Could not collect
  • HIP runtime version: N/A
  • MIOpen runtime version: N/A
  • Versions of relevant libraries:
  • [pip3] numpy==1.19.1
  • [pip3] torch==1.5.1
  • [pip3] torchvision==0.6.1
  • [conda] Could not collect

Additional context

Also tried to get the pre-trained model with:
model = torch.hub.load('pytorch/vision:v0.6.0', 'shufflenet_v2_x2_0', pretrained=True)
and it raised:
RuntimeError: Cannot find callable shufflenet_v2_x2_0 in hubconf

@gallardorafael
Copy link
Author

I found that models are unavailable. Model URLs are None in lines 13-18 of shufflenetv2.py:

model_urls = {
    'shufflenetv2_x0.5': 'https://download.pytorch.org/models/shufflenetv2_x0.5-f707e7126e.pth',
    'shufflenetv2_x1.0': 'https://download.pytorch.org/models/shufflenetv2_x1-5666bf0f80.pth',
    'shufflenetv2_x1.5': None,
    'shufflenetv2_x2.0': None,
}

so it raises the following:

if model_url is None:
            raise NotImplementedError('pretrained {} is not supported as of now'.format(arch))

at lines 169 and 170 of the same file.

I don't know if this is a bug or it's all ok, so I'll leave it open.

@oke-aditya
Copy link
Contributor

Hi It is not a bug 😅 PyTorch is yet to provide Pre Trained weights, for these. Marking for #2707 .

@gallardorafael
Copy link
Author

Thank you, I was a little bit confused. So I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants