BackgroundMattingV2 icon indicating copy to clipboard operation
BackgroundMattingV2 copied to clipboard

No module named 'torchvision.models.segmentation'

Open mayanktiwariiiitdmj opened this issue 4 years ago • 1 comments

Hello,

When I am running the inference_webcam.py file the I am getting the following exception.

Traceback (most recent call last):
  File "inference_webcam.py", line 29, in <module>
    from model import MattingBase, MattingRefine
  File "F:\PycharmProjects\init_BackgroundMattingV2\model\__init__.py", line 1, in <module>
    from .model import Base, MattingBase, MattingRefine
  File "F:\PycharmProjects\init_BackgroundMattingV2\model\model.py", line 4, in <module>
    from torchvision.models.segmentation.deeplabv3 import ASPP
ModuleNotFoundError: No module named 'torchvision.models.segmentation'

I have used the following commands in anaconda to install the packages

conda install pytorch==1.7.0 torchvision==0.8.1 torchaudio==0.7.0 cudatoolkit=10.1 -c pytorch

pip install kornia==0.4.1
pip install tensorboard==2.3.0
pip install tqdm==4.51.0
pip install opencv-python==4.4.0.44
pip install onnxruntime==1.6.0

Please help me in solving the error.

mayanktiwariiiitdmj avatar Oct 04 '21 11:10 mayanktiwariiiitdmj

pytorch==1.7.0 好像是要使用cuda 11.0

yoyoyin0902 avatar Jan 08 '22 13:01 yoyoyin0902