chengdazhi / Deformable-Convolution-V2-PyTorch

Deformable ConvNets V2 (DCNv2) in PyTorch
MIT License
1.44k stars 229 forks source link

runs very slowly #61

Open jialeli1 opened 4 years ago

jialeli1 commented 4 years ago

Has anyone used this and found it to run very slowly? I added two layers of DeformConv to the existing network, and the running time was doubled. Does anyone have any suggestions on this strange problem? Please give me some hints. Thanks!

crocodilegogogo commented 4 years ago

I have a question. We used Deformable Conv in classification tasks. We set the training batchsize the same as im2col_step. During the test process, we put different numbers of test samples in test batch (e.g. test the testing dataset by input one sample per time, or test the testing dataset by inputing ten samples per time), and get different classification results. It seems that how many samples we input to the network each time impacts the final classification results. So why is this happening? Will you kindly give me some advice? What's the relationship between testing batchsize and im2col_step? What's the relationship between training batchsize and im2col_step?

jialeli1 commented 4 years ago

I have a question. We used Deformable Conv in classification tasks. We set the training batchsize the same as im2col_step. During the test process, we put different numbers of test samples in test batch (e.g. test the testing dataset by input one sample per time, or test the testing dataset by inputing ten samples per time), and get different classification results. It seems that how many samples we input to the network each time impacts the final classification results. So why is this happening? Will you kindly give me some advice? What's the relationship between testing batchsize and im2col_step? What's the relationship between training batchsize and im2col_step?

I am not quite sure about the relationship between batchsize and im2col_step.
In other tasks (not using DCN), I also got different results when using different batch_size in the inference process. I am also very confused. In addition, when I used the matching CUDA version, DCN was not so slow.

crocodilegogogo commented 4 years ago

是啊哥们,推理过程中的batchsize确实影响测试精度。我发现如果训练batchsize和img2col_step保持一致,推理过程中的batchsize只要是训练batchsize的整数倍,那么得到的测试结果都一样。但测试集不可能是训练batchsize的整数倍,总会有余数,这些余数不知道能不能测对。或者直接把img2col_step设置为1,这样无论如何都能测对吧。。。

FightStone commented 4 years ago

@jialeli1 Hi, which version of cuda are you using? when i use cuda10.0.130 pytorch1.4.0 and dcn_pytorch1.0.0, model training is very slowly. Thx.

jialeli1 commented 4 years ago

@jialeli1 Hi, which version of cuda are you using? when i use cuda10.0.130 pytorch1.4.0 and dcn_pytorch1.0.0, model training is very slowly. Thx.

I use cuda101 and pytorch1.4. But when I recompile the version recommended by the author, it works fine.