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

IndexError: The shape of the mask [1, 1, 1, 512, 512] at index 2 does not match the shape of the indexed tensor [1, 1, 512, 512] at index 2 #37

Open
hanyao666 opened this issue Apr 7, 2024 · 1 comment

Comments

@hanyao666
Copy link

I tried running the code using the image in the sample, but encountered the following error. I am a beginner in this field, how can I solve it?
IndexError: The shape of the mask [1, 1, 1, 512, 512] at index 2 does not match the shape of the indexed tensor [1, 1, 512, 512] at index 2

@kosirobwada
Copy link

I encountered the same issue. Changing the line 288 in scripts/face_swap.py to fixed the problem.

hole_index = hole_map[None, None] == 255
is_foreground[hole_index] = True

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