Reputation: 429
I keep getting this error when using numpy:
Warning (from warnings module):
File "somepath.py", line 249
return 1 / ( 1 + np.exp( -x))
RuntimeWarning: overflow encountered in exp
However this doesn't tell me anything, as I still have no idea how it got to this error. Usually when I get an error it traces back through the functions it went through to get to the error, but not with exp overflow.
How do I get an error in which it does show me this?
Upvotes: 1
Views: 180
Reputation: 49794
You can ask Python to turn the warning into an error:
import warnings
warnings.filterwarnings("error", category=RuntimeWarning)
(Docs)
Upvotes: 2