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

large image generation will take a lot of memory. #6

Closed
watsonyanghx opened this issue Jun 5, 2018 · 2 comments
Closed

large image generation will take a lot of memory. #6

watsonyanghx opened this issue Jun 5, 2018 · 2 comments

Comments

@watsonyanghx
Copy link

If I want to generate image of size 512*512, the attention module will take int(64 / 8)*(512 ** 2) = 2097152,the parameters will take a lot of memory. Is the self-attention not suitable for large image generation? How to solve this?

@heykeetae
Copy link
Owner

heykeetae commented Jun 6, 2018

In my view, there are two solutions. In this implementation, feature number N is equal to pixel number. However, the paper does not indicate strictly if feature should be a pixel. Thus a quick solution is 1) EntonyTang's interpretation, #1 (where the pitfall is you have only one feature. Not sure if this is correct. In this way, are attention maps as in the paper possible?) or another possible application is to 2) group a set of pixels as one feature, such as 10x10 pixels to get one attention map, to form less number of attention maps per layer.

@heykeetae
Copy link
Owner

We have updated the 'sagan_models.py'! please check it out!

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