Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot produce results using the pretrained model #34

Closed
changliu19 opened this issue Jul 15, 2020 · 3 comments
Closed

Cannot produce results using the pretrained model #34

changliu19 opened this issue Jul 15, 2020 · 3 comments

Comments

@changliu19
Copy link

Hi,

I just read your paper and appreciate your well-organized code very much. But I cannot produce results using the pre-trained model.

image

I am not quite sure where the problem is. Did I use the wrong command?

python -u -m dmn_pytorch.train 
--data /home/xxx/dms_data 
--dataset unc 
--val testA 
--backend dpn92 
--num-filters 10 
--lang-layers 3 
--mix-we 
--save-folder ./checkpoints 
--snapshot /home/xxx/DMS/checkpoints/dmn_unc_weights.pth 
--epochs 0 
--eval-first
@changliu19
Copy link
Author

By the way, I noticed that the default batch size in the program is set to 1. But when I try to increase the batch size value, I got

RuntimeError: stack expects each tensor to be equal size, but got [3, 512, 512] at entry 0 and [3, 342, 512] at entry 1

It seems that the code kept the aspect ratio of the original image when doing resize so that images in the same batch are of different sizes. I wonder that was your model trained with the batch size of 1? Thank you!

@13331112522
Copy link

plus --high-res

@andfoy
Copy link
Contributor

andfoy commented Jul 28, 2020

@ntuLC Sorry for the late reply. Please take a look at the discussion of #21 (comment) and see if it solves this one. As @13331112522, you might be missing the --high-res flag, as the pretrained weights are high-resolution ones. Also, please take into account that the dependencies of this project are very old and values may vary with latest releases of PyTorch/SRU.

Regarding the question about the batch size, we had to train our model with a batch size of 1, due to memory constraints and also due to the dynamic convolution computations which do not allow batch dimension computation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants