Vision: Add windows support please

Created on 10 Sep 2017  路  21Comments  路  Source: pytorch/vision

I am wondering if anyone is developing a win64 branch of torchvision.
I've been following the conversation regarding installing pytorch on Windows, and I have @peterjc123 version of PyTorch running successfully (thanks, @peterjc123!).

Most helpful comment

This helped for me (order is important)

  1. conda install -c peterjc123 pytorch
  2. pip install torchvision

All 21 comments

@tzwilliams You can install torchvision through pip. Just pip install torchvision is fine.

@tzwilliams torchvision should work just fine on windows (provided you can get pytorch running)

Given that torchvision is a python-only library, it should work just fine on Windows.
I'm closing the issue, but let me know if you face any problems running it on Windows.

Thanks everyone. I had previously tried conda install torchvision and been told that there was no win64 build available. Of course, I should have also tried pip! It looks like everything is up and running now. Thanks for the help.

capture1

Hi tzWilliams,

I am getting this error while installing torchvision in windows. Can you please share how did you install it ? I am using pytorch in vitualenv using conda.

@Sudhakar17 is pytorch already installed before running this?

@Sudhakar17 I've never used virtualenv, but I'm happy to share the notes I took back when I did get pytorch and torchvision working.

Directly answering your question about torchvision, once I had pytorch setup in Windows the torchvision install was successfully completed with pip install torchvision

It sounds like you don't need this piece, but for installing pytorch in Windows I first followed the instructions at https://www.superdatascience.com/pytorch/. I later installed the updated version of pytorch available at https://anaconda.org/peterjc123/pytorch/files

I hope that helps! Good luck.

This helped for me (order is important)

  1. conda install -c peterjc123 pytorch
  2. pip install torchvision

@stepanveret Does it have any cons?

@Sudhakar17
Hi, I have the same problem then you. Did you could solve it?! It would be very nice if anyone could help me. I have installed pytorch successfully using anaconda, but can't install torchvision.

Thank you.

@Bestiplays I don't have experience with Windows, but torchvision is a python-only package, if you can't install it via pip, you could clone the repo and do something like

python setup.py install

from the cloned torchvision folder (with the proper translation to Windows commands, that I unfortunately don't know)

@Bestiplays stepanveret's method does work!
you should do it on Anaconda prompt

I am installed torchvison successfully in window on anaconda but when i import the module it shows .DLL file error. I have also installed all VCS in anaconda but nothing works. Please give me the solution @fmassa

@GANESHKUMAR7860 Can you post the full traceback here? I guess the problem is on PIL, not torchvision.

@peterjc123 please give some solutions for this error. Thank you
Traceback (most recent call last):
File "", line 1, in
import torchvision
File "C:\Users\A.GANESH KUMAR\Anaconda3\lib\site-packages\torchvision__init__.py", line 2, in
from torchvision import datasets
File "C:\Users\A.GANESH KUMAR\Anaconda3\lib\site-packages\torchvisiondatasets__init__.py", line 1, in
from .lsun import LSUN, LSUNClass
File "C:\Users\A.GANESH KUMAR\Anaconda3\lib\site-packages\torchvisiondatasets\lsun.py", line 2, in
from PIL import Image
File "C:\Users\A.GANESH KUMAR\Anaconda3\lib\site-packages\PIL\Image.py", line 58, in
from . import _imaging as core
ImportError: DLL load failed: The specified module could not be found.

@GANESHKUMAR7860 Can you try to update PIL (Pillow), please?

pip install --upgrade Pillow

@peterjc123
When i import the torchvision in jupyter notebook . It shows some error and i have installed the pillow also. solutions please?
ImportError Traceback (most recent call last)
in ()
----> 1 import torchvision

~\Anaconda3\lib\site-packages\torchvision__init__.py in ()
1 from torchvision import models
----> 2 from torchvision import datasets
3 from torchvision import transforms
4 from torchvision import utils
5

~\Anaconda3\lib\site-packages\torchvisiondatasets__init__.py in ()
----> 1 from .lsun import LSUN, LSUNClass
2 from .folder import ImageFolder, DatasetFolder
3 from .coco import CocoCaptions, CocoDetection
4 from .cifar import CIFAR10, CIFAR100
5 from .stl10 import STL10

~\Anaconda3\lib\site-packages\torchvisiondatasets\lsun.py in ()
1 import torch.utils.data as data
----> 2 from PIL import Image
3 import os
4 import os.path
5 import six

~\Anaconda3\lib\site-packages\PIL\Image.py in ()
58 # Also note that Image.core is not a publicly documented interface,
59 # and should be considered private and subject to change.
---> 60 from . import _imaging as core
61 if PILLOW_VERSION != getattr(core, 'PILLOW_VERSION', None):
62 raise ImportError("The _imaging extension was built for another "

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

Excuse me any solution for the above error please.

@GANESHKUMAR7860 Would you please uninstall torchvision and Pillow and then reinstall them?

@peterjc123
I did it but nothing works. Thank's.

conda install pytorch-cpu -c pytorch
pip3 install torchvision

I was facing a similar problem earlier. The first command was running fine. But the second one was showing error.
There were two installations of pip. One was inside the installation directory of python and the other was inside Miniconda. This was causing the conflict.
I removed the pip from the installation directory of python using the following command :-
python -m pip uninstall pip

After that, the second command ran successfully.
Then, I was able to do "import torch" and "import torchvision" from Anaconda Prompt.

Was this page helpful?
0 / 5 - 0 ratings