Pre-trained shufflenetv2_x1.5 and shufflenetv2_x2.0 raise "...not supported as of now". 路 Issue #3257 路 pytorch/vision (original) (raw)

馃悰 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

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