I am getting warnings like these when running numpy on reasonably large pipeline.
RuntimeWarning: invalid value encountered in true_divide
RuntimeWarning: invalid value encountered in greater
How do I find where they are occurring in the code besides writing dozens of print statements?
Python 2.7 and numpy 1.8.1
One way is to convert the warnings to errors:
import warnings
warnings.simplefilter('error', RuntimeWarning)
Then the traceback will tell you where the error occurred.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With