'torch vision: libc++abi: terminating with uncaught exception of type std::length_error: vector

recently, I started having a weird error when importing torch vision. I have freshly installed MacBook M1, latest Monterey build 12.3.1. Mini-forge is the first thing installed. When I try to import torchvision I get following error:

Python 3.9.12 | packaged by conda-forge | (main, Mar 24 2022, 23:24:38) 
Type 'copyright', 'credits' or 'license' for more information
IPython 8.2.0 -- An enhanced Interactive Python. Type '?' for help.
PyDev console: using IPython 8.2.0
Python 3.9.12 | packaged by conda-forge | (main, Mar 24 2022, 23:24:38) 
[Clang 12.0.1 ] on darwin

In[2]: import torchvision
libc++abi: terminating with uncaught exception of type std::length_error: vector
Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

I tried googling it and cannot find any solution. It might be connected to recent Monterey update? I frankly don't know what happened. Can you pls, help?



Solution 1:[1]

I had the same error when I upgraded torch from 1.10.2 to 1.11.0. Downgrade helped me.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tony