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

about size match of tensor #131

Open
zcdliuwei opened this issue May 9, 2024 · 4 comments
Open

about size match of tensor #131

zcdliuwei opened this issue May 9, 2024 · 4 comments

Comments

@zcdliuwei
Copy link

First of all, thank you for your amazing open source project
I used the following image as my low resolution input, with width and height of 512 and 768 respectively:
d7bc8707-94c4-4c2a-a031-3e0764396b31

Then, I wanted to super-resolution to 1024 and executed the following command:
python scripts/sr_val_ddpm_text_T_vqganfin_oldcanvas_tile.py --config configs/stableSRNew/v2-finetune_text_T_512.yaml --ckpt ckpt/stablesr_turbo.ckpt --init-img inputs/test_example --outdir output --ddpm_steps 4 --dec_w 0.5 --seed 42 --n_samples 1 --vqgan_ckpt ckpt/vqgan_cfw_00011.ckpt --colorfix_type wavelet --upscale 2

Then I received the following error message:
image

Strangely, when I changed upscale to 1, 3, 4, 5, 6, and 7, I all got the expected results, except for an error when upscale=2 was reported,I hope to receive your guidance,thanks!

@IceClear
Copy link
Owner

IceClear commented May 9, 2024

Hi. This is because you are using a tile size larger than your image size. See here.

@zcdliuwei
Copy link
Author

Hi. This is because you are using a tile size larger than your image size. See here.

Thank you for your reply

Do you mean that the tile size should be smaller than the target resolution of 1024, in my case?

But when I used the following command, specifying tile size=1600, which is greater than the target resolution of 1024, I obtained the correct super-resolution result:
python scripts/sr_val_ddpm_text_T_vqganfin_oldcanvas_tile.py --config configs/stableSRNew/v2-finetune_text_T_512.yaml --ckpt ckpt/stablesr_turbo.ckpt --init-img inputs/test_example --outdir output --ddpm_steps 4 --dec_w 0.5 --seed 42 --n_samples 1 --vqgan_ckpt ckpt/vqgan_cfw_00011.ckpt --colorfix_type wavelet --upscale 2 --vqgantile_size 1600

Similarly, when I scaled down tile size=512 and vqgantile_strid=500, there was no error reported:
python scripts/sr_val_ddpm_text_T_vqganfin_oldcanvas_tile.py --config configs/stableSRNew/v2-finetune_text_T_512.yaml --ckpt ckpt/stablesr_turbo.ckpt --init-img inputs/test_example --outdir output --ddpm_steps 4 --dec_w 0.5 --seed 42 --n_samples 1 --vqgan_ckpt ckpt/vqgan_cfw_00011.ckpt --colorfix_type wavelet --upscale 2 --vqgantile_size 512 --vqgantile_strid 500

@IceClear
Copy link
Owner

Hi. Sry for the late reply since I am quite busy recently. It seems like a size checking problem since the default tile size of sr_val_ddpm_text_T_vqganfin_oldcanvas_tile is 1280 and for images below 1280 we usually use sr_val_ddpm_text_T_vqganfin_oldcanvas w/o tiling. You may either adjust the default tiling size in sr_val_ddpm_text_T_vqganfin_oldcanvas_tile or try sr_val_ddpm_text_T_vqganfin_oldcanvas.

@zcdliuwei
Copy link
Author

Hi. Sry for the late reply since I am quite busy recently. It seems like a size checking problem since the default tile size of sr_val_ddpm_text_T_vqganfin_oldcanvas_tile is 1280 and for images below 1280 we usually use sr_val_ddpm_text_T_vqganfin_oldcanvas w/o tiling. You may either adjust the default tiling size in sr_val_ddpm_text_T_vqganfin_oldcanvas_tile or try sr_val_ddpm_text_T_vqganfin_oldcanvas.

Thank you for your kind reply
I will give it a try soon

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

2 participants