I installed the lastest
torchvision nightly as per online instructions, eager to testdrive M1 GPU support. Testing with
True (yeah!). But when running
YoloX model, the system crashes with the following error:
ox_files/detector.py", line 321, in _postprocess nms_out_index = torchvision.ops.nms( File "/usr/local/Caskroom/miniforge/base/envs/pt/lib/python3.8/site-packages/torchvision/ops/boxes.py", line 40, in nms _assert_has_ops() File "/usr/local/Caskroom/miniforge/base/envs/pt/lib/python3.8/site-packages/torchvision/extension.py", line 33, in _assert_has_ops raise RuntimeError( 2022-05-30 11:07:08 root ERROR: 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.
NB: The above code has been CI/CD-tested and runs perfectly on M1 macOS (torch cpu), Intel macOS, Windows and Linux, so it’s not a code error.
My M1 MacBook Air specs:
- macOS 12.3.1
- python 3.8
From the error messages, it seems that either
torchvision.ops.nmsis buggy, or
torchvisionversions are incompatible.
Wonder if any one knows whether it is
1, in which case I will abort my M1 test until later builds, or
2, how do I get and build a compatible
torchvision version (appreciate some detailed instructions/commands here).