0
votes

I am not able to import torchvision despite successful installation.  

Environment OS : Windows

runfile('C:/Users/kundan/Desktop/Computer_Vision/Computer_Vision_A_Z_Template_Folder/Module 2 - Object Detection/data/untitled1.py', wdir='C:/Users/kundan/Desktop/Computer_Vision/Computer_Vision_A_Z_Template_Folder/Module 2 - Object Detection/data') Traceback (most recent call last):

File "C:\Users\kundan\Desktop\Computer_Vision\Computer_Vision_A_Z_Template_Folder\Module 2 - Object Detection\data\untitled1.py", line 8, in import torchvision

File "C:\Users\kundan.conda\envs\mynewflaskenv\lib\site-packages\torchvision_init_.py", line 1, in from torchvision import models

File "C:\Users\kundan.conda\envs\mynewflaskenv\lib\site-packages\torchvision\models_init_.py", line 11, in from . import detection

File "C:\Users\kundan.conda\envs\mynewflaskenv\lib\site-packages\torchvision\models\detection_init_.py", line 1, in from .faster_rcnn import *

File "C:\Users\kundan.conda\envs\mynewflaskenv\lib\site-packages\torchvision\models\detection\faster_rcnn.py", line 7, in from torchvision.ops import misc as misc_nn_ops

File "C:\Users\kundan.conda\envs\mynewflaskenv\lib\site-packages\torchvision\ops_init_.py", line 1, in from .boxes import nms, box_iou

File "C:\Users\kundan.conda\envs\mynewflaskenv\lib\site-packages\torchvision\ops\boxes.py", line 2, in from torchvision import _C

ImportError: DLL load failed: The specified module could not be found.

1

1 Answers

0
votes

This usually happens with some python libraries.

This video can help you: http://www.youtube.com/watch?v=xmvRF7koJ5E)

1 .Download msvcp71.dll and msvcr71.dll from the web.
2 .Save them to your C:\Windows\System32 folder.
3 .Save them to your C:\Windows\SysWOW64 folder as well (if you have a 64-bit operating system).

Now try running your code file in Python .