Failed to load image Python extension: '/home/jianguo/.conda/envs/pixelformer/lib/python3.8/site-packages/torchvision/image.so: undefined symbol: _ZNK3c107SymBool10guard_boolEPKcl'If you don't plan on using image functionality from `torchvision.io`, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have `libjpeg` or `libpng` installed before building `torchvision` from source?
时间: 2024-04-15 21:31:42 浏览: 315
It seems that you are facing an issue with loading the Python extension for the torchvision library. The error message indicates that there is an undefined symbol related to the `libjpeg` or `libpng` libraries.
To resolve this issue, you can try the following steps:
1. Make sure that you have `libjpeg` and `libpng` libraries installed on your system. You can install them using a package manager like `apt` (for Ubuntu) or `brew` (for macOS).
2. If you have already installed these libraries, it's possible that they are not properly linked. In that case, you can try reinstalling them and then reinstalling the `torchvision` library.
For example, on Ubuntu, you can run the following commands:
```shell
sudo apt-get install libjpeg-dev libpng-dev
pip install --no-cache-dir -I torchvision
```
On macOS with Homebrew, you can run:
```shell
brew install libjpeg libpng
pip install --no-cache-dir -I torchvision
```
3. If the issue still persists, it might be related to the specific environment or configuration you are using. In that case, you can try creating a new virtual environment and installing the required packages again.
I hope this helps! Let me know if you have any further questions.
阅读全文