Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Amanda-Barbara opened this issue Jun 5, 2018 · 5 comments
Open

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

Amanda-Barbara opened this issue Jun 5, 2018 · 5 comments

Comments

@Amanda-Barbara
Copy link

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!

@yingcong
Copy link
Collaborator

yingcong commented Jun 5, 2018

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]

@Amanda-Barbara
Copy link
Author

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.

@yingcong
Copy link
Collaborator

yingcong commented Jun 5, 2018

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.

@Amanda-Barbara
Copy link
Author

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

@yingcong
Copy link
Collaborator

yingcong commented Jun 5, 2018

Great! You are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants