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

SR part error : Input and output sizes should be greater than 0, but got input (H: 16, W: 16) output (H: 0, W: 0) #25

Closed
syeona opened this issue Apr 12, 2023 · 5 comments

Comments

@syeona
Copy link

syeona commented Apr 12, 2023

Here, factor = 1 and low_level_feat = [64, 64]
please help me. .

image

Error message :
Exception has occurred: RuntimeError
Input and output sizes should be greater than 0, but got input (H: 16, W: 16) output (H: 0, W: 0)

File "/home/server-3/desktop/yeona/SuperYOLO-main/models/sr_decoder_noBN_noD.py", line 38, in forward
x = F.interpolate(x, size=[i*(factor // 2) for i in low_level_feat.size()[2:]], mode='bilinear', align_corners=True)
File "/home/server-3/desktop/yeona/SuperYOLO-main/models/deeplabedsr.py", line 60, in forward
x_sr= self.sr_decoder(x, low_level_feat,self.factor)
File "/home/server-3/desktop/yeona/SuperYOLO-main/models/SRyolo.py", line 243, in forward_once
output_sr = self.model_up(y[self.l1],y[self.l2]) #在超分上加attention
File "/home/server-3/desktop/yeona/SuperYOLO-main/models/SRyolo.py", line 190, in forward
y,output_sr,features = self.forward_once(steam,'yolo', profile) #zjq
File "/home/server-3/desktop/yeona/SuperYOLO-main/models/SRyolo.py", line 117, in init
m.stride = torch.tensor([s / x.shape[-2] for x in self.forward(torch.zeros(1, ch_steam, s, s),torch.zeros(1, ch_steam, s, s),input_mode)[0]]) # forward
File "/home/server-3/desktop/yeona/SuperYOLO-main/train.py", line 102, in train
model = Model(opt.cfg, input_mode = opt.input_mode ,ch_steam=opt.ch_steam,ch=opt.ch, nc=nc, anchors=hyp.get('anchors'),config=None,sr=opt.super,factor=down_factor).to(device) # create
File "/home/server-3/desktop/yeona/SuperYOLO-main/train.py", line 673, in
train(hyp, opt, device, tb_writer)
RuntimeError: Input and output sizes should be greater than 0, but got input (H: 16, W: 16) output (H: 0, W: 0)

@PrisonMike-Guy
Copy link

@syeona
This has to do with the down_factor/factor parameter. Right now it is 1, but it should be 2.

I hard coded it to 2 in line 98 from train.py

This solved it for me, I hope this solves it for you as well!

@syeona
Copy link
Author

syeona commented Apr 12, 2023

@syeona This has to do with the down_factor/factor parameter. Right now it is 1, but it should be 2.

I hard coded it to 2 in line 98 from train.py

This solved it for me, I hope this solves it for you as well!

Thank you so much ! I fixed it by referring to this ! After specifying downsampling factor to 2, a dimensional error occurred, so setting EDSR factor to 4 and it returned. Have a good day :-)

@PrisonMike-Guy
Copy link

@syeona
Awesome to hear that you managed to fix it! Thank you very much and I wish you a good day as well!

@syeona
Copy link
Author

syeona commented Apr 12, 2023

Oh No.. It doesn't work after being trained to some extent during training. There seems to be a problem with my solution. Please let me know if you have any other solutions to this problem. Thank you

@PrisonMike-Guy
Copy link

@syeona
Could you provide more information about your problem? Maybe I can help with the solution.

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