lama icon indicating copy to clipboard operation
lama copied to clipboard

no test network ffc.py

Open zouxuelian opened this issue 2 years ago • 2 comments

When I test ffc.py, I get a runtimeError: give groups=1,weight of size [inchannel,inchannel,kernel_size,kernel_size],expected input [1,inchannel2,H,W],to have 10 inchannel,but got inchannel2 instead. But it works when training. So I want to ask if this ffc.py can't do network testing

zouxuelian avatar Jul 11 '22 09:07 zouxuelian

I faced a similar issue while testing the FFC block separately.

fo_conv = FFC(in_channels=3, out_channels=3, kernel_size=3,
                 ratio_gin=0.5, ratio_gout=0.5)
    x = torch.randn((1,3,256,256))
    print(x)
    print(x.shape)
    out1, out2 = fo_conv(x)
    print(out1.shape, out2.shape)

I am getting the following error message:

RuntimeError: Given groups=1, weight of size [2, 2, 3, 3], expected input[1, 3, 256, 256] to have 2 channels, but got 3 channels instead.

Would appreciate if the contributors help us resolve this issue.

Edit: The same error occurs while testing FFCResnetBlock According to the following error:

RuntimeError: Given groups=1, weight of size [2, 2, 3, 3], expected input[1, 3, 258, 258] to have 2 channels, but got 3 channels instead

the input must have 2 channels but even on changing the number of channels to 2, I got the following error:

TypeError: pad(): argument 'input' (position 1) must be Tensor, not int

AvirupJU avatar Jul 26 '22 00:07 AvirupJU

I faced a similar problem. The problem was due to ratio_gout in './configs/training/generator/ffc_resnet_075'. I set it to zero by mistake while it must equal 0.75. Changing its value solved my problem.

FBehrad avatar Aug 17 '22 11:08 FBehrad