cherubicXN / hawp

Holistically-Attracted Wireframe Parsing [TPAMI'23] & [CVPR' 20]
MIT License
291 stars 51 forks source link

Some questions about the pytorch version #31

Closed ewrfcas closed 2 years ago

ewrfcas commented 2 years ago

Results from pytorch1.9 have more disorderly lines compared with ones from pytorch1.3.1. Are there any bugs for it? Lines from pytorch1.9: image

Lines from pytorch1.3.1: image

My HAWP model was trained in pytorch1.3.1

cherubicXN commented 2 years ago

Yes, it is. It is due to that PyTorch changed the behavior of the division function. I remembered that I fixed the bug and you can update your code. For the old version, the performance will be dramatically dropped from 66.5 to 40+ for the official model.

ewrfcas commented 2 years ago

Thanks for your reply. I have tried to change the code. From y = (index / width).float() + torch.gather(joff[1], 0, index) + 0.5 to y = (index // width).float() + torch.gather(joff[1], 0, index) + 0.5. But this question is not solved...

Any other codes should be changed?

cherubicXN commented 2 years ago

Have you trained the model again after fixing the bug?

ewrfcas commented 2 years ago

I have retrained the model before fixing it.

cherubicXN commented 2 years ago

I have retrained the model before fixing it.

How about the evaluation results?

ewrfcas commented 2 years ago

I added some extra data augmentation, and the results are slightly better than the paper reported in torch1.3.1. But I have not tested them for quantitative metrics in torch1.9.

cherubicXN commented 2 years ago

I added some extra data augmentation, and the results are slightly better than the paper reported in torch1.3.1. But I have not tested them for quantitative metrics in torch1.9.

Maybe some other changes in PyTorch lead to your results. In recent days, I have extensively trained many models with PyTorch-1.10. I did not have observed any incorrect results on my side after fixing the abovementioned bug as you did.

ewrfcas commented 2 years ago

Thanks. I think that the model needs to be retrained in a new PyTorch version.

cherubicXN commented 2 years ago

Yes, it should be retrained.