BasicSR icon indicating copy to clipboard operation
BasicSR copied to clipboard

Error training for x2

Open davidjamesfriedman opened this issue 5 years ago • 9 comments

The size of tensor a (256) must match the size of tensor b (128) at non-singleton dimension 3

What do I need to change to fix this error?

davidjamesfriedman avatar Jul 10 '19 19:07 davidjamesfriedman

Here is the log of my training on X2 model. You can find the configs in the beginning.

train_002_MSRResNetx2_MSRResNetx4Ini_DIV2K_190609-174010.log

xinntao avatar Jul 11 '19 14:07 xinntao

Thank you! I read other comments that say I need to change something in the discriminator to avoid this error as well. Which file should I modify to change this?

davidjamesfriedman avatar Jul 11 '19 15:07 davidjamesfriedman

Do you use the RRDB-Net ? If so, you need to comment two lines as said in #174 .

xinntao avatar Jul 11 '19 15:07 xinntao

Yes I used RRDB-Net. I now get this error:

davidjamesfriedman avatar Jul 11 '19 17:07 davidjamesfriedman

RuntimeError: Error(s) in loading state_dict for RRDBNet: untimeError: Error(s) in loading state_dict for RRDBNet: Unexpected key(s) in state_dict: "upconv2.weight", "upconv2.bias".

davidjamesfriedman avatar Jul 11 '19 17:07 davidjamesfriedman

If you load the pre-trained X4 model, try to set strict_load: false

xinntao avatar Jul 13 '19 13:07 xinntao

RuntimeError: Error(s) in loading state_dict for RRDBNet: untimeError: Error(s) in loading state_dict for RRDBNet: Unexpected key(s) in state_dict: "upconv2.weight", "upconv2.bias".

Did this solve your problem? If you did run it, could I know the steps please?Thanks!

yl-to avatar Jul 16 '19 00:07 yl-to

@Alongstory Did you want to train the X2 model? If so, this should work - set strict_load: false.

xinntao avatar Jul 16 '19 05:07 xinntao

it worked for my case! @xinntao

yptheangel avatar May 11 '22 18:05 yptheangel