Issue 1:
🐛 Bug

To Reproduce

I have created a Python package with PyTorch and torchvision as dependencies:

requirements.txt

# Image Preprocessing
pims_nd2>=1.0,<1.1
nd2reader>=3.2.3,<4.0.0
read-roi>=1.6.0,<2.0.0

scikit-image>=0.17.2,<1.0.0
opencv-python<=4.2.0.30

numpy>=1.18.5,<2.0.0

# ML libraries
torch>=1.6.0,<2.0.0
torchvision>=0.7.0,<1.0.0

# GUI
PyQt5>=5.11.3,<5.13.0

# Utils
tqdm

setup.py

# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open

# Get the long description from the README file
with open('README.md', 'r', encoding='utf-8') as f:
long_description = f.read()

def parse_requirements(filename):
""" load requirements from a pip requirements file """
lineiter = (line.strip() for line in open(filename))
return [line for line in lineiter if line and not line.startswith("#")]

install_reqs = parse_requirements("requirements.txt")

# Arguments marked as "Required" below must be included for upload to PyPI.
# Fields marked as "Optional" may be commented out.

setup(
********************************
install_requires=install_reqs, # Optional

include_package_data=True,
data_files=[
("","requirements.txt")
]
)

The problem is that when I install my package on Windows no PyTorch and torchvision gets downloaded. In Linux it works perfectly.

Expected behavior

It should work as in Linux done

cc @peterjc123 @maxluk @nbcsm @guyang3532 @gunandrose4u @smartcat2010 @mszhanyi

Issue 2:
🐛 Bug

While installing from source on windows, build fails with the error

To Reproduce

Steps to reproduce the behavior:

Install pytorch from source as per below steps.

cd ~\Desktop

git clone --recursive https://github.com/pytorch/pytorch

cd ~\Desktop\pytorch

set "VS150COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build"

set CMAKE_GENERATOR=Visual Studio 15 2017 Win64

set DISTUTILS_USE_SDK=1

set "PREBUILD_COMMAND=%VS140COMNTOOLS%....\VC\vcvarsall.bat"

set PREBUILD_COMMAND_ARGS=x64

call "%VS150COMNTOOLS%\vcvarsall.bat" x64 -vcvars_ver=14.11

python setup.py install

Error message as below.

"C:\Users<username>\Desktop\pytorch\build\INSTALL.vcxproj" (default target) (1) ->

"C:\Users<username>\Desktop\pytorch\build\ALL_BUILD.vcxproj" (default target) (3) ->

"C:\Users<username>\Desktop\pytorch\build\caffe2\AlgorithmsTest.vcxproj" (default target) (4) ->

"C:\Users<username>\Desktop\pytorch\build\caffe2\caffe2_gpu.vcxproj" (default target) (22) ->

(CustomBuild target) ->

c:\users<username>\desktop\pytorch\third_party\eigen\eigen\src/Core/arch/CUDA/Half.h(212): error : more than one instance of overloaded function "__hadd" matches the argument list: [C:\Users<username>\Desktop\pytorch

\build\caffe2\caffe2_gpu.vcxproj]

Expected behavior

Build to complete properly

Environment

Windows

Collecting environment information...
PyTorch version: 1.0.0a0+0f9807e
Is debug build: No
CUDA used to build PyTorch: 9.0

OS: Microsoft Windows 10 Pro
GCC version: (Rev5, Built by MSYS2 project) 5.3.0
CMake version: version 3.12.2

Python version: 3.6
Is CUDA available: Yes
CUDA runtime version: 9.0.176
GPU models and configuration: GPU 0: GeForce GTX 1080
Nvidia driver version: 397.93
cuDNN version: Probably one of the following:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\cudnn64_7.dll

Versions of relevant libraries:
[pip] Could not collect
[conda] cuda90 1.0 0 pytorch
[conda] pytorch 0.4.1 py36_cuda90_cudnn7he774522_1 pytorch
[conda] torch 1.0.0a0+0f9807e <pip>
[conda] torchtext 0.2.3 <pip>
[conda] torchvision 0.2.0 <pip>
[conda] torchvision-nightly 0.2.1 <pip>

PyTorch Version (e.g., 1.0): 1.0

OS (e.g., Linux): Windows

How you installed PyTorch (conda, pip, source): source

Build command you used (if compiling from source): given above

Python version:3.6.6

CUDA/cuDNN version:9.0

GPU models and configuration:GTX 1080

Any other relevant information: N/A

Additional context

To fix the error and ensure that the compile is successful, Modify the following lines in (where pytorch git source is cloned)

~\Desktop\pytorch\third_party\eigen\Eigen\src\Core\arch\CUDA\Half.h

EIGEN_STRONG_INLINE device half operator + (const half& a, const half& b) {

return __hadd(::__half(a), ::__half(b));

// return __hadd(a, b);

}

EIGEN_STRONG_INLINE device half operator * (const half& a, const half& b) {

return __hmul(a, b);

}

EIGEN_STRONG_INLINE device half operator - (const half& a, const half& b) {

return __hsub(a, b);

}

EIGEN_STRONG_INLINE device half operator / (const half& a, const half& b) {

return __hdiv(a, b);

// float num = __half2float(a);

// float denom = __half2float(b);

// return __float2half(num / denom);

}