Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No such operator torchvision::nms

When I try to run yoloV3 detect,it happend the error

op = torch._C._jit_get_operation(qualified_op_name)

RuntimeError: No such operator torchvision::nms

Though this code is the source code of torchvision ,I try sevaral time to correct the code by the tips with failure.

like image 744
Noodles Avatar asked Feb 16 '20 10:02

Noodles


People also ask

What is torchvision?

The torchvision package consists of popular datasets, model architectures, and common image transformations for computer vision. Transforming and augmenting images. Scriptable transforms. Compositions of transforms. Transforms on PIL Image and torch.*Tensor.

What is NMS Pytorch?

Performs non-maximum suppression (NMS) on the boxes according to their intersection-over-union (IoU). NMS iteratively removes lower scoring boxes which have an IoU greater than iou_threshold with another (higher scoring) box.

What is OPS in Pytorch?

ops implements operators, losses and layers that are specific for Computer Vision. All operators have native support for TorchScript.


2 Answers

As I met lot of hurdles to install torch and torchvison ,I'm not reluctant to reinstall the enviroment.Running 'conda list' the version of torch and torchvison ,I found they are not incompitable,the versions of two packages installed are:

 torchvision-0.5.0+cu92-cp37-cp37m-win_amd64.whl
 torch-1.4.0+cpu-cp37-cp37m-win_amd64.whl

I change the version of torchvison to

 torchvision-0.5.0+cpu-cp37-cp37m-win_amd64.whl

I have dealt with my proplem until now. note: the enviroment of my os and python are fellowing:

  Windows_X64
  python3.7
like image 127
Noodles Avatar answered Oct 15 '22 00:10

Noodles


I had the same problem on Ubuntu 18.04. Upgrading python to 3.8 and Installing fresh torch and torchvision libraries worked for me.

virtualenv -p python3.8 torch17
source torch17/bin/activate
pip install cython matplotlib tqdm scipy ipython ninja yacs opencv-python ffmpeg opencv-contrib-python Pillow scikit-image scikit-learn lmfit imutils pyyaml jupyterlab==3
pip install torch==1.7.1+cu101 torchvision==0.8.2+cu101 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html

I tried the solutions discussed in some pytorch forums and github but that did not help.

like image 34
Abhi25t Avatar answered Oct 15 '22 01:10

Abhi25t