pytorch / vision

Datasets, Transforms and Models specific to Computer Vision
https://pytorch.org/vision
BSD 3-Clause "New" or "Revised" License
15.98k stars 6.92k forks source link

windows10 cmake torchvision cuda doesn't work #1903

Open hylrh2008 opened 4 years ago

hylrh2008 commented 4 years ago

windows10+cuda10.1+vs2017 when i cmake torchvision with CUDA but it doesn't work.i change enable_language(CUDA) as find_package(CUDA) but it still only compile cpu file.

fmigneault commented 4 years ago

Check this issue: https://github.com/pytorch/vision/issues/1865 I'm working with Windows10+cuda10.1+vs2019 and it works for me using specified fixes. I'm currently running ResNet152 training on GPU.

Patches I applied : https://github.com/fmigneault/vision/tree/windows-patches Hope this helps you.

hylrh2008 commented 4 years ago

@fmigneault thank you but It doesn't work for me although i change my compiler to vs2019. this is my vs setting: QQ截图20200224111447 QQ截图20200224112642

it seems like cmake can't find cuda compiler link to vs.could i see your vs setting screenshot? thank you

fmigneault commented 4 years ago

Configurations look like this for me:

image

And include directories: image

Make sure that CUDA and CUDNN libraries and include directories can be found adequately. Otherwise I think CMake disables WITH_CUDA option.

LI-Wen-Jiang commented 4 years ago

@fmigneault I am using the same Windows10 + cuda10.1 + vs2019 with you. But I make error. Can you descripe your steps to cmake torchvision, thanks.

LI-Wen-Jiang commented 4 years ago

@hylrh2008 Did you slove your problem, I have the the same problem with you.

fmigneault commented 4 years ago

@LI-Wen-Jiang I did these modifications to make it work: https://github.com/fmigneault/vision/commit/9983a277f731b76f9c71dd4dbcd93abbc0666b04