when I am using
import torchvision.transforms
I am getting the following error:
Traceback (most recent call last):
File ".\mask.py", line 4, in <module>
import torchvision.transforms
File "C:\Users\ssk\Anaconda3\lib\site-packages\torchvision\__init__.py", line 1, in <module>
from torchvision import models
File "C:\Users\ssk\Anaconda3\lib\site-packages\torchvision\models\__init__.py", line 11, in <module>
from . import detection
File "C:\Users\ssk\Anaconda3\lib\site-packages\torchvision\models\detection\__init__.py", line 1, in <module>
from .faster_rcnn import *
File "C:\Users\ssk\Anaconda3\lib\site-packages\torchvision\models\detection\faster_rcnn.py", line 7, in <module>
from torchvision.ops import misc as misc_nn_ops
File "C:\Users\ssk\Anaconda3\lib\site-packages\torchvision\ops\__init__.py", line 1, in <module>
from .boxes import nms, box_iou
File "C:\Users\ssk\Anaconda3\lib\site-packages\torchvision\ops\boxes.py", line 2, in <module>
from torchvision import _C
ImportError: DLL load failed: The specified module could not be found.
I am doing this first time and have the latest packages
torch -1.16.2
(base) PS C:UserssskDesktopMachineLearningPytorch> pip install torchvision
Requirement already satisfied: torchvision in c:userssskanaconda3libsite-packages (0.3.0)
Requirement already satisfied: six in c:userssskanaconda3libsite-packages (from torchvision) (1.12.0)
Requirement already satisfied: torch>=1.1.0 in c:userssskanaconda3libsite-packages (from torchvision) (1.1.0)
Requirement already satisfied: numpy in c:userssskanaconda3libsite-packages (from torchvision) (1.16.2)
Requirement already satisfied: pillow>=4.1.1 in c:userssskanaconda3libsite-packages (from torchvision) (5.4.1)
I see that many people mentioned this is addressed in .30 the version I am gaving.
can you pl help me to unblock
This looks like a duplicate of https://github.com/pytorch/vision/issues/1018
@peterjc123 is this the same issue?
@fmassa Yes, I think so. If you use torch-nightly, then you'll need to build torchvision by yourself.
Closing via @peterjc123 comment, let's keep the discussion centralized in #1018 if it's the same then.
Use torchvision 0.2.2
Even though downgrading to torchvision 0.2.2 solved that issue. But in my case i need mobilenet which is only available in version 0.3.0.
Can someone please help me solving this issue ?
torch version 1.1.0
torchvision 0.3.0
OS: WINDOWS
Importing torchvision leads to the issue:
from torchvision import _C
ImportError: DLL load failed: The specified module could not be found.
@nikhilchh Are you using the nightly one or the stable one? If you are using the nightly one, please use torchvision 0.4.0 instead. Or, you could just update to pytorch 1.2.0 and torchvision 0.4.0.
@peterjc123 As conda installation was unsuccessful so I had to download whl file manually for pytorch. And I could not find for 1.2 pytorch whl file. So I ended up with 1.1 pytorch cp36 cpu.
After that I tried to install torchvision (pip install torchvision). And to me it seems like 0.4.0 is not available for windows. So I had to settle with 0.3.0.
Please use the commands on https://pytorch.org. We didn't host the Windows wheels on PyPI.
It is not working with pip or conda commands that I get from that website. (Tried both stable and nightly)
This is the error I get:
Collecting package metadata (current_repodata.json): failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url https://conda.anaconda.org/pytorch/win-64/current_repodata.json
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
SSLError(MaxRetryError('HTTPSConnectionPool(host='conda.anaconda.org', port=443): Max retries exceeded with url: /pytorch/win-64/current_repodata.json (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))'))
@nikhilchh Maybe your HTTPS connection gets interrupted due to some unknown reasons. Would you please download the following two wheels and then pip install ...?
@peterjc123 Thanks a lot. That was really helpful :) Solved my problem.
Most helpful comment
Use torchvision 0.2.2