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

“OverflowError: Python int too large to convert to C long” on 64-bit windows #1

Open
WandiX opened this issue Apr 17, 2018 · 2 comments

Comments

@WandiX
Copy link

WandiX commented Apr 17, 2018

Hi,

I tried to run the image analysis on 64-bit Windows. When the process goes to decode(), the overflow error arises. I changed
map_negative_range = np.vectorize(lambda element: float(element) if element <= Q/2 else element - Q)
to
map_negative_range = np.vectorize(lambda element: float(element) if element <= Q/2 else element - Q, otypes=[np.float64])
The error goes away, but two warnings arise:
tensor.py:102: RuntimeWarning: overflow encountered in exp
tensor.py:81: RuntimeWarning: invalid value encountered in true_divide
I tried to ignore the warnings, but the prediction results are not good (50% - 60% I guess).
Any idea how to deal with?

Thanks!

@zerotas
Copy link

zerotas commented Apr 18, 2019

Hi,

I tried to run the image analysis on 64-bit Windows. When the process goes to decode(), the overflow error arises. I changed
map_negative_range = np.vectorize(lambda element: float(element) if element <= Q/2 else element - Q)
to
map_negative_range = np.vectorize(lambda element: float(element) if element <= Q/2 else element - Q, otypes=[np.float64])
The error goes away, but two warnings arise:
tensor.py:102: RuntimeWarning: overflow encountered in exp
tensor.py:81: RuntimeWarning: invalid value encountered in true_divide
I tried to ignore the warnings, but the prediction results are not good (50% - 60% I guess).
Any idea how to deal with?

Thanks!

Excuse me, have you fixed the problem?

@WandiX
Copy link
Author

WandiX commented Apr 21, 2019

Hi,
I tried to run the image analysis on 64-bit Windows. When the process goes to decode(), the overflow error arises. I changed
map_negative_range = np.vectorize(lambda element: float(element) if element <= Q/2 else element - Q)
to
map_negative_range = np.vectorize(lambda element: float(element) if element <= Q/2 else element - Q, otypes=[np.float64])
The error goes away, but two warnings arise:
tensor.py:102: RuntimeWarning: overflow encountered in exp
tensor.py:81: RuntimeWarning: invalid value encountered in true_divide
I tried to ignore the warnings, but the prediction results are not good (50% - 60% I guess).
Any idea how to deal with?
Thanks!

Excuse me, have you fixed the problem?

No. I tried but I couldn't fix.

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