0

Resizing image in imageai-detector /usr/local/lib/python3.6/site-packages/imageai/Detection/Custom/init.py:1234: RuntimeWarning: overflow encountered in exp return 1. / (1. + np.exp(-x))

I keep getting this warning, it seems like it has to do with this function inside init.py:

@staticmethod 
def _sigmoid(x):
    return 1./(1. + np.exp(-x))

Can we expect some updates of this module, or is it possible to fix it? Just ignore it?

PYTHON_VERSION=3.6.0 tensorflow-gpu==1.13.1 keras==2.2.4

TkrA
  • 439
  • 1
  • 5
  • 19
  • Can you properly explain what the problem is?, i mean what you are trying to achieve. – izbid Aug 25 '21 at 10:50
  • I have a `detector = CustomObjectDetection()`, from **imageai.Detection.Custom**, which uses `detectObjectsFromImage` to make predictions on images (custom YoloV3 model, trained to detect license plates). The detector runs smoothly, but I keep getting this warning.. – TkrA Aug 25 '21 at 11:22

1 Answers1

1

This warning basically means the value returned by np.exp(-x) is larger than float64 precision.

You can ignore this warning, since in Tensorflow model precision of float64 is more than enough and numpy will handle the approximation.

However, you can still try with np.float64 and then np.float128 as dtype to check if the warning goes.

1./(1. + np.exp(-x, dtype=np.float128))