Issue 1:
Dear all, for some reason, I recently started to have problems with torchvision, although it looks like I haven't changed anything recently.

Do you have any idea what happened ?

Thank you in advance for your help

import segmentation_models_pytorch as smp
File "/usr/local/lib/python3.6/dist-packages/segmentation_models_pytorch/__init__.py", line 1, in <module>
from .unet import Unet
File "/usr/local/lib/python3.6/dist-packages/segmentation_models_pytorch/unet/__init__.py", line 1, in <module>
from .model import Unet
File "/usr/local/lib/python3.6/dist-packages/segmentation_models_pytorch/unet/model.py", line 3, in <module>
from ..encoders import get_encoder
File "/usr/local/lib/python3.6/dist-packages/segmentation_models_pytorch/encoders/__init__.py", line 4, in <module>
from .resnet import resnet_encoders
File "/usr/local/lib/python3.6/dist-packages/segmentation_models_pytorch/encoders/resnet.py", line 28, in <module>
from torchvision.models.resnet import ResNet
File "/usr/local/lib/python3.6/dist-packages/torchvision/__init__.py", line 5, in <module>
from torchvision import models
File "/usr/local/lib/python3.6/dist-packages/torchvision/models/__init__.py", line 12, in <module>
from . import detection
File "/usr/local/lib/python3.6/dist-packages/torchvision/models/detection/__init__.py", line 1, in <module>
from .faster_rcnn import *
File "/usr/local/lib/python3.6/dist-packages/torchvision/models/detection/faster_rcnn.py", line 7, in <module>
from torchvision.ops import misc as misc_nn_ops
File "/usr/local/lib/python3.6/dist-packages/torchvision/ops/__init__.py", line 1, in <module>
from .boxes import nms, box_iou
File "/usr/local/lib/python3.6/dist-packages/torchvision/ops/boxes.py", line 43, in <module>
@torch.jit._script_if_tracing
AttributeError: module 'torch.jit' has no attribute '_script_if_tracing'

Which versions am I using:

pip freeze | grep torch

efficientnet-pytorch==0.6.3

segmentation-models-pytorch==0.1.0

torch==1.4.0

torchvision==0.5.0

cc @suo @gmagogsfm

Issue 2:
🐛 Bug

Error using the pytorch.hub API:

code:

import torch

from torch import hub

resnet18_model = hub.load('pytorch/vision:master','resnet18',pretrained=True)

Error

Downloading: "https://github.com/pytorch/vision/archive/master.zip" to /home/pratik/.cache/torch/hub/master.zip

AttributeError Traceback (most recent call last)

in

3 resnet18_model = hub.load('pytorch/vision:master',

4 'resnet18',

----> 5 pretrained=True)

~/anaconda3/lib/python3.7/site-packages/torch/hub.py in load(github, model, *args, **kwargs)

363 sys.path.insert(0, repo_dir)

364

--> 365 hub_module = import_module(MODULE_HUBCONF, repo_dir + '/' + MODULE_HUBCONF)

366

367 entry = _load_entry_from_hubconf(hub_module, model)

~/anaconda3/lib/python3.7/site-packages/torch/hub.py in import_module(name, path)

73 spec = importlib.util.spec_from_file_location(name, path)

74 module = importlib.util.module_from_spec(spec)

---> 75 spec.loader.exec_module(module)

76 return module

77 elif sys.version_info >= (3, 0):

~/anaconda3/lib/python3.7/importlib/_bootstrap_external.py in exec_module(self, module)

~/anaconda3/lib/python3.7/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

~/.cache/torch/hub/pytorch_vision_master/hubconf.py in

3

4 # classification

----> 5 from torchvision.models.alexnet import alexnet

6 from torchvision.models.densenet import densenet121, densenet169, densenet201, densenet161

7 from torchvision.models.inception import inception_v3

~/.cache/torch/hub/pytorch_vision_master/torchvision/init.py in

3 from .extension import _HAS_OPS

4

----> 5 from torchvision import models

6 from torchvision import datasets

7 from torchvision import ops

~/.cache/torch/hub/pytorch_vision_master/torchvision/models/init.py in

10 from .shufflenetv2 import *

11 from . import segmentation

---> 12 from . import detection

13 from . import video

14 from . import quantization

~/.cache/torch/hub/pytorch_vision_master/torchvision/models/detection/init.py in

----> 1 from .faster_rcnn import *

2 from .mask_rcnn import *

3 from .keypoint_rcnn import *

~/.cache/torch/hub/pytorch_vision_master/torchvision/models/detection/faster_rcnn.py in

5 import torch.nn.functional as F

6

----> 7 from torchvision.ops import misc as misc_nn_ops

8 from torchvision.ops import MultiScaleRoIAlign

9

~/.cache/torch/hub/pytorch_vision_master/torchvision/ops/init.py in

----> 1 from .boxes import nms, box_iou

2 from .new_empty_tensor import _new_empty_tensor

3 from .deform_conv import deform_conv2d, DeformConv2d

4 from .roi_align import roi_align, RoIAlign

5 from .roi_pool import roi_pool, RoIPool

~/.cache/torch/hub/pytorch_vision_master/torchvision/ops/boxes.py in

40

41

---> 42 @torch.jit._script_if_tracing

43 def batched_nms(

44 boxes: Tensor,

AttributeError: module 'torch.jit' has no attribute '_script_if_tracing'

Environment

PyTorch version: 1.5.0

Is debug build: No

CUDA used to build PyTorch: None

OS: Ubuntu 20.04 LTS

GCC version: (Ubuntu 9.3.0-10ubuntu2) 9.3.0

CMake version: version 3.16.3

Python version: 3.7

Is CUDA available: No

CUDA runtime version: No CUDA

GPU models and configuration: No CUDA

Nvidia driver version: No CUDA

cuDNN version: No CUDA

Versions of relevant libraries:

[pip3] numpy==1.18.0

[pip3] numpydoc==0.9.1

[pip3] torch==1.5.0

[pip3] torchvision==0.6.0a0+82fd1c8

[conda] _tflow_select 2.3.0 mkl

[conda] blas 1.0 mkl

[conda] cpuonly 1.0 0 pytorch

[conda] mkl 2019.4 243

[conda] mkl-service 2.3.0 py37he904b0f_0

[conda] mkl_fft 1.0.14 py37ha843d7b_0

[conda] mkl_random 1.1.0 py37hd6b4f25_0

[conda] numpy 1.16.2 pypi_0 pypi

[conda] numpy-base 1.17.2 py37hde5b4d6_0

[conda] numpydoc 0.9.1 py_0

[conda] pytorch 1.5.0 py3.7_cpu_0 [cpuonly] pytorch

[conda] tensorflow-base 2.0.0 mkl_py37h9204916_0

[conda] torchvision 0.6.0 py37_cpu [cpuonly] pytorch

cc @suo @gmagogsfm