Repository: pytorch
Issue: Torch hub: object has no attribute nms
Labels: triaged,module: docker

## 🐛 Bug

Using docker `pytorch/pytorch`

```
root@90479d02671b:/workspace# python -c "import torch.hub; torch.hub.load('pytorch/vision', 'deeplabv3_resnet101', pretrained=True)"
Downloading: "https://github.com/pytorch/vision/archive/master.zip" to /root/.cache/torch/hub/master.zip
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/conda/lib/python3.7/site-packages/torch/hub.py", line 365, in load
    hub_module = import_module(MODULE_HUBCONF, repo_dir + '/' + MODULE_HUBCONF)
  File "/opt/conda/lib/python3.7/site-packages/torch/hub.py", line 75, in import_module
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/root/.cache/torch/hub/pytorch_vision_master/hubconf.py", line 5, in <module>
    from torchvision.models.alexnet import alexnet
  File "/root/.cache/torch/hub/pytorch_vision_master/torchvision/__init__.py", line 5, in <module>
    from torchvision import models
  File "/root/.cache/torch/hub/pytorch_vision_master/torchvision/models/__init__.py", line 12, in <module>
    from . import detection
  File "/root/.cache/torch/hub/pytorch_vision_master/torchvision/models/detection/__init__.py", line 1, in <module>
    from .faster_rcnn import *
  File "/root/.cache/torch/hub/pytorch_vision_master/torchvision/models/detection/faster_rcnn.py", line 7, in <module>
    from torchvision.ops import misc as misc_nn_ops
  File "/root/.cache/torch/hub/pytorch_vision_master/torchvision/ops/__init__.py", line 1, in <module>
    from .boxes import nms, box_iou
  File "/root/.cache/torch/hub/pytorch_vision_master/torchvision/ops/boxes.py", line 7, in <module>
    @torch.jit.script
  File "/opt/conda/lib/python3.7/site-packages/torch/jit/__init__.py", line 1290, in script
    fn = torch._C._jit_script_compile(qualified_name, ast, _rcb, get_default_args(obj))
RuntimeError:
object has no attribute nms:
  File "/root/.cache/torch/hub/pytorch_vision_master/torchvision/ops/boxes.py", line 41
        by NMS, sorted in decreasing order of scores
    """
    return torch.ops.torchvision.nms(boxes, scores, iou_threshold)
           ~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
```

## To Reproduce

Steps to reproduce the behavior:

1. `docker run -it -v --gpus all pytorch/pytorch`
2. `python -c "import torch.hub; torch.hub.load('pytorch/vision', 'deeplabv3_resnet101', pretrained=True)"`

<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->

## Expected behavior

Model should download and load without fail.

## Environment

```
root@a15507f00c1b:/workspace# python collect_env.py
Collecting environment information...
PyTorch version: 1.5.0
Is debug build: No
CUDA used to build PyTorch: 10.1

OS: Ubuntu 18.04.4 LTS
GCC version: Could not collect
CMake version: Could not collect

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: Could not collect
GPU models and configuration: GPU 0: GeForce RTX 2080 Ti
Nvidia driver version: 440.82
cuDNN version: Could not collect

Versions of relevant libraries:
[pip] numpy==1.18.1
[pip] torch==1.5.0
[pip] torchvision==0.6.0a0+82fd1c8
[conda] blas                      1.0                         mkl
[conda] cudatoolkit               10.1.243             h6bb024c_0
[conda] mkl                       2020.0                      166
[conda] mkl-service               2.3.0            py37he904b0f_0
[conda] mkl_fft                   1.0.15           py37ha843d7b_0
[conda] mkl_random                1.1.0            py37hd6b4f25_0
[conda] numpy                     1.18.1           py37h4f9e942_0
[conda] numpy-base                1.18.1           py37hde5b4d6_1
[conda] pytorch                   1.5.0           py3.7_cuda10.1.243_cudnn7.6.3_0    pytorch
[conda] torchvision               0.6.0                py37_cu101    pytorch
```

 - PyTorch Version (e.g., 1.0): 1.5.0
 - OS (e.g., Linux): NixOS 20.03 unstable -> run docker image pytorch/pytorch
 - How you installed PyTorch (`conda`, `pip`, source): NA
 - Build command you used (if compiling from source): NA
 - Python version: 3.7.7
 - CUDA/cuDNN version: 440.82
 - GPU models and configuration: GeForce RTX 2080Ti
 - Any other relevant information: