milesial / Pytorch-UNet

PyTorch implementation of the U-Net for image semantic segmentation with high quality images
GNU General Public License v3.0
9.32k stars 2.52k forks source link

Missing urllib3.exceptions causing an error #512

Open HANJIAC opened 2 months ago

HANJIAC commented 2 months ago

Which version of urllib3 should I install? The requirements do not mention any information about urllib3. Is it because the version of urllib3 is too high?

Here is some version information and error messages. Versions of some packages related to CUDA and Pytorch in the Anaconda virtual environment

# Name                    Version                   Build  Channel
urllib3                   2.2.2           py310h06a4308_0    defaults
cuda-cudart               11.7.99                       0    nvidia
cuda-cupti                11.7.101                      0    nvidia
cuda-libraries            11.7.1                        0    nvidia
cuda-nvrtc                11.7.99                       0    nvidia
cuda-nvtx                 11.7.91                       0    nvidia
cuda-runtime              11.7.1                        0    nvidia
cuda-version              12.6                          3    nvidia
python                    3.10.14              h955ad1f_1    defaults
python-dateutil           2.9.0.post0              pypi_0    pypi
python-slugify            8.0.4                    pypi_0    pypi
pytorch                   1.13.1   py3.10_cuda11.7_cudnn8.5.0_0    pytorch
pytorch-cuda              11.7                 h778d358_5    pytorch
pytorch-mutex             1.0                        cuda    pytorch

Error message:

Traceback (most recent call last):
  File "/home/asd/J/train.py", line 9, in <module>
    import torchvision.transforms as transforms
  File "/home/asd/anaconda3/envs/J-U_Net/lib/python3.10/site-packages/torchvision/__init__.py", line 5, in <module>
    from torchvision import datasets, io, models, ops, transforms, utils
  File "/home/asd/anaconda3/envs/J-U_Net/lib/python3.10/site-packages/torchvision/datasets/__init__.py", line 1, in <module>
    from ._optical_flow import FlyingChairs, FlyingThings3D, HD1K, KittiFlow, Sintel
  File "/home/asd/anaconda3/envs/J-U_Net/lib/python3.10/site-packages/torchvision/datasets/_optical_flow.py", line 12, in <module>
    from .utils import _read_pfm, verify_str_arg
  File "/home/asd/anaconda3/envs/J-U_Net/lib/python3.10/site-packages/torchvision/datasets/utils.py", line 22, in <module>
    import requests
  File "/home/asd/anaconda3/envs/J-U_Net/lib/python3.10/site-packages/requests/__init__.py", line 45, in <module>
    from .exceptions import RequestsDependencyWarning
  File "/home/asd/anaconda3/envs/J-U_Net/lib/python3.10/site-packages/requests/exceptions.py", line 7, in <module>
    from urllib3.exceptions import HTTPError as BaseHTTPError
ModuleNotFoundError: No module named 'urllib3.exceptions'