minivision-ai / Silent-Face-Anti-Spoofing

静默活体检测(Silent-Face-Anti-Spoofing)
Apache License 2.0
1.36k stars 453 forks source link

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

Open confetti12 opened 6 months ago

confetti12 commented 6 months ago

Hi Minivision team, your work is so great. it help me for my thesis. Thank you

But, I have tried use my own picture to train. i use RGB with picture size 80x80. But when i run the train, there is error RuntimeError: Given groups=1, weight of size [32, 3, 3, 3], expected input[1, 80, 80, 3] to have 3 channels, but got 80 channels instead. I dont why, my picture read as NHWC format not NCHW. I have tried to change 3 channels to 80 channel it seems the train is success to run but when the input come to FTGenerator in MultiFTNet the input is not [1, 1, 10, 10] but got [1, 1, 10, 1] and make the FTGenerator result is not perfect. Maybe because the MiniFASNet read input as TensorFlow data format [1, 80, 80, 3] not PyTorch data format [1, 3, 80 ,80]. What should i do?

mebcrtz commented 4 months ago

hi! i have also encountered this error, would you mind if i asked if you were able to find a solution to this?