XinyiYing / D3Dnet

Repository for "Deformable 3D Convolution for Video Super-Resolution", SPL, 2020
Apache License 2.0
305 stars 43 forks source link

About the cuda #22

Closed November666 closed 3 years ago

November666 commented 3 years ago

Hello!Is the purpose of using C++ to speed up training? Can it be done without C++ extension?

XinyiYing commented 3 years ago

The purpose of using C++ is to speed up the training process by the parallel computation of cuda. For windows users, they have to install "Visual Studio" for C++ code compilation. The compilation is done by the function "cpp_extension" of pytorch, which accomplish the compilation and produce a bag named "D3D" in the folder ".\Anaconda3\Lib\site-packages". Then, you can use "D3D" in your code. For ubuntu users, they do not have to install any external software and can use "D3D" only after run "bash make.sh".

November666 commented 3 years ago

您好,我进行编译的时候报了这样的错误,是由于pytorch版本的问题嘛 ,我的torchversion是0.8的

------------------ 原始邮件 ------------------ 发件人: "XinyiYing/D3Dnet" @.>; 发送时间: 2021年5月6日(星期四) 晚上7:21 @.>; @.**@.>; 主题: Re: [XinyiYing/D3Dnet] About the cuda (#22)

The purpose of using C++ is to speed up the training process by the parallel computation of cuda. For windows users, they have to install "Visual Studio" for C++ code compilation. The compilation is done by the function "cpp_extension" of pytorch, which accomplish the compilation and produce a bag named "D3D" in the folder ".\Anaconda3\Lib\site-packages". Then, you can use "D3D" in your code. For ubuntu users, they do not have to install any external software and can use "D3D" only after run "bash make.sh".

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

XinyiYing commented 3 years ago

我看不到你报的错误的图片,麻烦再上传一次

November666 commented 3 years ago

谢谢您耐心的解答!这是我报错的错误提示,还想再请问一下,如果直接用纯python的deformable convolution速度会很慢吗?

------------------ 原始邮件 ------------------ 发件人: "XinyiYing/D3Dnet" @.>; 发送时间: 2021年5月7日(星期五) 上午9:50 @.>; @.**@.>; 主题: Re: [XinyiYing/D3Dnet] About the cuda (#22)

我看不到你报的错误的图片,麻烦再上传一次

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

November666 commented 3 years ago

C:\Users\wgfy.conda\envs\py37gpu\lib\site-packages\torch\utils\cpp_extension.py:274: UserWarning: Error checking compiler version for g++: Command 'g++' returned non-zero exit status 1.   warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error)) building 'DCN' extension C:\Users\wgfy.conda\envs\py37gpu\lib\site-packages\torch\utils\cpp_extension.py:274: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。   warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error)) 之前的图片好像还是看不了,我把报错的提示复制过来了 谢谢您耐心的解答!这是我报错的错误提示,还想再请问一下,如果直接用纯python的deformable convolution速度会很慢吗?

------------------ 原始邮件 ------------------ 发件人: "XinyiYing/D3Dnet" @.>; 发送时间: 2021年5月7日(星期五) 上午9:50 @.>; @.**@.>; 主题: Re: [XinyiYing/D3Dnet] About the cuda (#22)

我看不到你报的错误的图片,麻烦再上传一次

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

XinyiYing commented 3 years ago

打开cpp_extension.py,把编码改成' gbk',即下述行修改 match = re.search(r'(\d+).(\d+).(\d+)', compiler_info.decode(' gbk').strip())

November666 commented 3 years ago

Emitting ninja build file E:\code\D3Dnet-f3ca2483d37430d113a0b920030d37d8b50c5006\D3Dnet-f3ca2483d37430d113a0b920030d37d8b50c5006\code\dcn\build\temp.win-amd64-3.7\Release\build.ninja... error: [Errno 2] No such file or directory: 'E:\code\D3Dnet-f3ca2483d37430d113a0b920030d37d8b50c5006\D3Dnet-f3ca2483d37430d113a0b920030d37d8b50c5006\code\dcn\build\temp.win-amd64-3.7\Release\build.ninja'

再麻烦您一下,请问这个错误该怎么解决呢,谢谢

------------------ 原始邮件 ------------------ 发件人: "XinyiYing/D3Dnet" @.>; 发送时间: 2021年5月7日(星期五) 下午5:35 @.>; @.**@.>; 主题: Re: [XinyiYing/D3Dnet] About the cuda (#22)

打开cpp_extension.py,把编码改成' gbk',即下述行修改 match = re.search(r'(\d+).(\d+).(\d+)', compiler_info.decode(' gbk').strip())

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

XinyiYing commented 3 years ago

这个问题我没有见过,我猜测可能是 ninja build系统不符合环境配置。建议使用ubuntu系统完成编译比较简单,windows因为环境配置问题经常会出现奇怪的报错。

November666 commented 3 years ago

好的,万分感谢

------------------ 原始邮件 ------------------ 发件人: "XinyiYing/D3Dnet" @.>; 发送时间: 2021年5月8日(星期六) 上午10:28 @.>; @.**@.>; 主题: Re: [XinyiYing/D3Dnet] About the cuda (#22)

这个问题我没有见过,我猜测可能是 ninja build系统不符合环境配置。建议使用ubuntu系统完成编译比较简单,windows因为环境配置问题经常会出现奇怪的报错。

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.