【问题标题】:Imageai detector RuntimeWarningImageai 检测器 RuntimeWarning
【发布时间】:2021-10-25 08:07:38
【问题描述】:

在 imageai-detector 中调整图像大小 /usr/local/lib/python3.6/site-packages/imageai/Detection/Custom/init.py:1234: RuntimeWarning:exp 中遇到溢出 返回 1. / (1. + np.exp(-x))

我不断收到此警告,似乎与 init.py 中的此函数有关:

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

我们可以期待这个模块的一些更新,还是可以修复它?直接忽略?

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

【问题讨论】:

  • 你能正确解释问题是什么吗?我的意思是你想要达到的目标。
  • 我有一个来自 imageai.Detection.Customdetector = CustomObjectDetection(),它使用 detectObjectsFromImage 对图像进行预测(自定义 YoloV3 模型,经过训练可检测车牌) .检测器运行平稳,但我不断收到此警告..

标签: python tensorflow imageai


【解决方案1】:

这个警告基本上意味着np.exp(-x)返回的值大于float64的精度。

您可以忽略此警告,因为在 Tensorflow 模型中,float64 的精度已经绰绰有余,numpy 将处理近似值。

但是,您仍然可以尝试使用np.float64,然后使用np.float128 作为dtype 来检查警告是否出现。

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

【讨论】:

    猜你喜欢
    • 2021-03-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-10
    • 2022-12-28
    • 2021-04-14
    • 2019-04-19
    相关资源
    最近更新 更多