I am getting this error while importing torchvision:
AttributeError                            Traceback (most recent call last)
<ipython-input-159-07ce7fca6932> in <module>
      5 from torch.utils.data import Dataset, DataLoader
      6 from PIL import Image
----> 7 import torchvision
      8 
      9 

~/.cache/torch/hub/pytorch_vision_master/torchvision/__init__.py in <module>
      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 <module>
     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 <module>
----> 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 <module>
      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 <module>
----> 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 <module>
     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'

P.S I am working in a virtual environment in a remote server. In google colab, I could import torchvision. What may be the reason?