Facelet_Bank icon indicating copy to clipboard operation
Facelet_Bank copied to clipboard

input.size[1] == 3 but got 4 instead

Open Amanda-Barbara opened this issue 6 years ago • 5 comments

Hi,@yingcong , it has 4 channels when I input a color picture with your code like this: facelet do you know the reason? thank you!

Amanda-Barbara avatar Jun 05 '18 09:06 Amanda-Barbara

Hi @Amanda-Barbara , do you use a png image? If so, the last channel should be a A channel. You can simply ignored it by using img = img[:, :, :3]

yingcong avatar Jun 05 '18 11:06 yingcong

yeah,I have done it, the last channel value are same. when I ran 940th picture there have an error like this: RuntimeError: cuda runtime error (2) : out of memory at /pytorch/torch/lib/THC/generic/THCStorage.cu:66 but I did not modify the code on other place.

Amanda-Barbara avatar Jun 05 '18 12:06 Amanda-Barbara

Seems like an out-of-memory problem. May be the gpu is occupied or the size of the image is too large. If you have multiple gpu, you can append "-gpu x" in your bash command, where x is the gpu id, such as 0,1 otherwise, you can append "-cpu" instead to use cpu mode.

yingcong avatar Jun 05 '18 12:06 yingcong

I have filtered the high-resolution images and the the project can go on running,thanks @yingcong

Amanda-Barbara avatar Jun 05 '18 13:06 Amanda-Barbara

Great! You are welcome.

yingcong avatar Jun 05 '18 15:06 yingcong