facenet-pytorch icon indicating copy to clipboard operation
facenet-pytorch copied to clipboard

Couldn't load custom C++ ops. This can happen if your PyTorch and torchvision versions are incompatible

Open fire717 opened this issue 4 years ago • 5 comments

I installed with pip install facenet-pytorch, then I run the fintune example, got this:

RuntimeError: Couldn't load custom C++ ops. This can happen if your PyTorch and torchvision versions are incompatible, or if you had errors while compiling torchvision from source. For further information on the compatible versions, check https://github.com/pytorch/vision#installation for the compatibility matrix. Please check your PyTorch version with torch.__version__ and your torchvision version with torchvision.__version__ and verify if they are compatible, and if not please reinstall torchvision so that it matches your PyTorch install.

OS: ubuntu python:3.7 torch:1.7.0 torchvision:0.8.1 cuda:10.1

fire717 avatar Jan 12 '21 08:01 fire717

While I conda activate to pytorch1.6 env, Got this:

RuntimeError: object has no attribute nms: File "/home/AlgorithmicGroup/yw/miniconda3/lib/python3.7/site-packages/torchvision/ops/boxes.py", line 40 by NMS, sorted in decreasing order of scores """ return torch.ops.torchvision.nms(boxes, scores, iou_threshold) ~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE 'nms' is being compiled since it was called from 'batched_nms' File "/home/AlgorithmicGroup/yw/miniconda3/lib/python3.7/site-packages/torchvision/ops/boxes.py", line 82 offsets = idxs.to(boxes) * (max_coordinate + torch.tensor(1).to(boxes)) boxes_for_nms = boxes + offsets[:, None] keep = nms(boxes_for_nms, scores, iou_threshold) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE return keep

fire717 avatar Jan 12 '21 08:01 fire717

I face the same issue. Any further progress on that?

Neihtq avatar Jan 24 '21 13:01 Neihtq

我面临着同样的问题。在这方面还有进一步的进展吗? conda activate yolov5启动就可以了

1755010418 avatar May 24 '21 06:05 1755010418

There are requirements for cuda toolkit, torch and torchvision versions combinations.

If you follow requirements listed below, you will see that torch:1.7.0 and torchvision:0.8.1 both requires cuda 10.2 https://pytorch.org/get-started/previous-versions/

But as you can see there is also specific versions of torch 1.7.0 and torchvision:0.8.1 for cuda 10.1. This recipe worked for me with cuda 11.4.

idcore avatar Aug 07 '21 04:08 idcore

os: ubuntu 20.04 platform: cpu python: 3.7 torch: 1.6.0+cpu torchvision: 0.7.0+cpu

this recipy is availabel for me

uninstallHahaha avatar Mar 27 '22 13:03 uninstallHahaha