numpy: Invalid value encountered in true_divide

You may have a NAN, INF, or NINF floating around somewhere. Try this:

np.isfinite(diff_images).all()
np.isfinite(b_0).all()

If one or both of those returns False, that’s likely the cause of the runtime error.

Leave a Comment