环境
- Win10
- NVIDIA GeForce RTX 2080
- python3.7
- cuda_10.1.105_418.96_win10
- cudnn-10.1-windows10-x64-v7.6.5.32
- tensorflow-gpu 1.15.0
- numpy 1.16.2
- Pillow 8.1.0
- scipy 1.1.0
- pycuda-2019.1.2+cuda101-cp37-cp37m-win_amd64.whl
- visual studio 2017 enterprise
Deep photo style transfer在windows10上运行
出现错误
pycuda.driver.CompileError: nvcc preprocessing failed
C:\Users\DELL\AppData\Local\Temp\tmpq6ryi07o.cu failed
tmp09uwxycc.cu failed, tmpmg493mk2.cu failed, tmpw55rj1nm.cu failed, tmpprfwu41e.cu failed, tmpwshgrr0g.cu failed, tmpc5f85qpl.cu failed
刚开始cuda为10.0版本,出现了这样的问题。第一感觉是pycuda-2019.1.2+cuda101-cp37-cp37m-win_amd64.whl和python和cuda不匹配导致,因为没有和Python3.7和cuda10.0对应的pycuda,然后就重装了cuda10.1。重装后还是出现这个问题,在网上搜了很多,一度以为没办法了,然后重新查看了Deep photo style transfer在github上的指导文件,deep-photo-styletransfer-tf_win这个版本。突然意识到重装之后忘记按照指导将Add getopt.h and unistd.h to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include,即将文件中自带的两个.h文件复制到你安装的cuda某个文件夹中。复制后重新运行,问题解决。运行成功截图。
路径设置仿照,参考2中的设置,即
parser.add_argument("--content_image_path", dest='content_image_path', nargs='?',default='E:/deep-photo-styletransfer-tf_win/examples/input/in11.png',
help="Path to the content image")等
风格设置,Style Options中的 default=2
参考1:deep-photo-styletransfer-tf_win链接为https://github.com/andrewginns/deep-photo-styletransfer-tf_win
参考2:https://blog.csdn.net/u013066730/article/details/103733628