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

RuntimeError: storage has wrong size: expected 0 got 1728 #12

Closed
simdjeff opened this issue Dec 22, 2021 · 4 comments
Closed

RuntimeError: storage has wrong size: expected 0 got 1728 #12

simdjeff opened this issue Dec 22, 2021 · 4 comments

Comments

@simdjeff
Copy link

simdjeff commented Dec 22, 2021

Exception has occurred: RuntimeError
RealBasicVSR: PerceptualLoss: storage has wrong size: expected 0 got 1728

During handling of the above exception, another exception occurred:

File "D:\Users......\RealBasicVSR-master\realbasicvsr\models\restorers\real_basicvsr.py", line 65, in init
super().init(generator, discriminator, gan_loss, pixel_loss,

During handling of the above exception, another exception occurred:

File "D:\Users......\RealBasicVSR-master\realbasicvsr\models\builder.py", line 20, in build
return build_from_cfg(cfg, registry, default_args)
File "D:\Users......\RealBasicVSR-master\realbasicvsr\models\builder.py", line 58, in build_model
return build(cfg, MODELS, dict(train_cfg=train_cfg, test_cfg=test_cfg))
File "D:\Users......\RealBasicVSR-master\inference_realbasicvsr.py", line 67, in init_model
model = build_model(config.model, test_cfg=config.test_cfg)
File "D:\Users......\RealBasicVSR-master\inference_realbasicvsr.py", line 81, in main
model = init_model(args.config, args.checkpoint)
File "D:\Users......\RealBasicVSR-master\inference_realbasicvsr.py", line 149, in
main()

@simdjeff
Copy link
Author

simdjeff commented Dec 24, 2021

This error is caused by PerceptualLoss. If PerceptualLoss is removed, the error will disappear. However it's not easy to handle PerceptualLoss. The downloaded “vgg19-dcbb9e9d.pth” file is put into the .cache/torch/hub/checkpoints, but the build_model function didn't work either.

@ckkelvinchan
Copy link
Owner

Hi @simdjeff, since we currently support test only, PerceptualLoss should not be used. What command did you use?

The training code will be released next week.

@simdjeff
Copy link
Author

simdjeff commented Dec 26, 2021

Hi @ckkelvinchan. I used the command
"python inference_realbasicvsr.py configs/realbasicvsr_x4.py checkpoints/RealBasicVSR_x4.pth data/demo_000 results/demo_000".
Yes, PerceptualLoss can not be used for all test files with PerceptualLoss in mmediting/tests. I suppose the error doesn't occur only in ReadBasicVSR.
The error occurs in the function "build_from_cfg". The PerceptualLoss is used in eq.(8) in the paper "Investigating Tradeoffs in Real-World Video Super-Resolution". I wonder how to make RealBasicVSR work when building a model with PerceptualLoss?
Thank you. I am looking forward to the new training code.

@ckkelvinchan
Copy link
Owner

Are you using Windows?

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