question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import DLL Error when using import torchvision.transforms

See original GitHub issue

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:\Users\ssk\Desktop\MachineLearning\Pytorch> pip install torchvision Requirement already satisfied: torchvision in c:\users\ssk\anaconda3\lib\site-packages (0.3.0) Requirement already satisfied: six in c:\users\ssk\anaconda3\lib\site-packages (from torchvision) (1.12.0) Requirement already satisfied: torch>=1.1.0 in c:\users\ssk\anaconda3\lib\site-packages (from torchvision) (1.1.0) Requirement already satisfied: numpy in c:\users\ssk\anaconda3\lib\site-packages (from torchvision) (1.16.2) Requirement already satisfied: pillow>=4.1.1 in c:\users\ssk\anaconda3\lib\site-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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

6reactions
Toulik-Dascommented, Aug 13, 2019

Use torchvision 0.2.2

1reaction
nikhilchhcommented, Oct 7, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"import torch" giving error "from torch._C import *, DLL load ...
I fixed this problem by downloading and installing the CUDA Toolkit directly from NVIDIA. It installed all required Visual Studio components.
Read more >
RuntimeError: import torchvision - vision - PyTorch Forums
It is very long error, the last line is: ImportError: DLL load failed: The specified module could not be found. It sounds like...
Read more >
从torch._c 导入* 错误, 从torchvision 导入_c dll 加载失败, From torch c ...
得到“ImportError: DLL load failed: The operating system cannot run ,from torch._C import * ImportError: DLL load failed: 操作系统无法运行%1。#以下一个很好用#。
Read more >
How to fix error when Importing Torchvision that return ...
On Ubuntu pip installs packages for the Python v2 environment, and you are using Python v3. Use pip3 instead.
Read more >
Fastai v1 install issues thread
testing that torchvision works. from fastai.text import * ... I had a missing dll error when importing torch but this was fixed with....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found