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

RuntimeError: quantile() input tensor is too large #40

Open
noivan0 opened this issue Apr 11, 2024 · 1 comment
Open

RuntimeError: quantile() input tensor is too large #40

noivan0 opened this issue Apr 11, 2024 · 1 comment

Comments

@noivan0
Copy link

noivan0 commented Apr 11, 2024

Traceback (most recent call last):
File "D:\code\git-DS\EfficientAD\efficientad.py", line 451, in
main()
File "D:\code\git-DS\EfficientAD\efficientad.py", line 268, in main
q_st_start, q_st_end, q_ae_start, q_ae_end = map_normalization(
File "C:\Users\2878045\AppData\Roaming\Python\Python39\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "D:\code\git-DS\EfficientAD\efficientad.py", line 374, in map_normalization
q_st_start = torch.quantile(maps_st, q=0.9)
RuntimeError: quantile() input tensor is too large

anyone solve this?

@FelixFu520
Copy link

Traceback (most recent call last): File "D:\code\git-DS\EfficientAD\efficientad.py", line 451, in main() File "D:\code\git-DS\EfficientAD\efficientad.py", line 268, in main q_st_start, q_st_end, q_ae_start, q_ae_end = map_normalization( File "C:\Users\2878045\AppData\Roaming\Python\Python39\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context return func(*args, **kwargs) File "D:\code\git-DS\EfficientAD\efficientad.py", line 374, in map_normalization q_st_start = torch.quantile(maps_st, q=0.9) RuntimeError: quantile() input tensor is too large

anyone solve this?

torch.quantile() limited process 16 million elements only,you could break maps_st into pieces, and process, like:
_q_st_start = []
for i in range(n):
_q_st_start,append(torch.quantile(maps_st[i: i+k], q=0.9))
q_st_start = torch.stack(_q_st_start).mean()

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