CIT icon indicating copy to clipboard operation
CIT copied to clipboard

Error while testing

Open SumanthJain2998 opened this issue 3 years ago • 2 comments

@Ha0Tang @Amazingren Hello, Thank you for the amazing repository. I was evaluating the network for JS and other metrics. I ran into an error while running the test.py for GMM

Screenshot 2021-09-30 at 4 01 12 PM

Can you please help me?

Thank you

SumanthJain2998 avatar Sep 30 '21 10:09 SumanthJain2998

You can change transforms.Normalize to transforms.Normalize((0.5), (0.5)) in cp_dataset.py. It will fix it. I had the same issue. and it got fixed.

The error happened because the first dimension of the tensor means the color, so what your error means is that you are giving a grayscale picture (1 channel), while the data loader expects a RGB image (3 channels). You defined a pil_loader function that returns an image in RGB, but you are never using it.

SheldonGeek avatar Oct 07 '21 04:10 SheldonGeek

After fixing the above error, I got a Runtime error: File "/kaggle/working/CIT/networks.py", line 228, in forward x = x.view(x.size(0), -1) RuntimeError: view size is not compatible with input tensor's size and stride

rkuo2000 avatar Jan 06 '22 18:01 rkuo2000