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

ValueError: Maximum allowed size exceeded #34

Open
bit0123 opened this issue Jul 27, 2020 · 5 comments · May be fixed by #77
Open

ValueError: Maximum allowed size exceeded #34

bit0123 opened this issue Jul 27, 2020 · 5 comments · May be fixed by #77

Comments

@bit0123
Copy link

bit0123 commented Jul 27, 2020

I am trying to computer Sinkhorn distance between two tensor of size 2x256. My data are quite sparse.
I got the folowing error:

File "/usr/local/lib/python3.6/dist-packages/geomloss/sinkhorn_samples.py", line 48, in sinkhorn_tensorized diameter, ε, ε_s, ρ = scaling_parameters( x, y, p, blur, reach, diameter, scaling ) File "/usr/local/lib/python3.6/dist-packages/geomloss/sinkhorn_divergence.py", line 72, in scaling_parameters ε_s = epsilon_schedule( p, diameter, blur, scaling ) File "/usr/local/lib/python3.6/dist-packages/geomloss/sinkhorn_divergence.py", line 61, in epsilon_schedule + [ blur**p ] ValueError: Maximum allowed size exceeded
Why this is happening and how can i solve this?
Any help is highly appreciated. Thanks

@AdrienCorenflos
Copy link
Contributor

I had the same issue, the scaling you're using is too close to 1.
@jeanfeydy I fixed it locally by using a generator. Do you want me to send a PR for that?

@bit0123
Copy link
Author

bit0123 commented Jul 27, 2020

PR would be great. Thanks

@AdrienCorenflos
Copy link
Contributor

Jean will correct me if I'm mistaken, but the real fix for you is to lower your scaling parameter I'd presume, except if you know you really, really can't do without this precision (also if you have put a scaling of 1 you will still end up having an infinite loop anyway, even with my PR)

@AEGISEDGE
Copy link

Hi there, I met the same question frequently. It seems the list of values created by np.arange is too long. So I tried with small scaling parameter (1e-3) but it came a again. So I wonder how can I do to fix or avoid this error? Thank u!

@A-Vzer
Copy link

A-Vzer commented Aug 28, 2021

For me it was the estimated diameter parameter becoming too large because of instable training. I looked at the magnitude of my samples and set the parameter myself.

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