【问题标题】:How to avoid Segmentation fault in pycocotools during decoding of RLE如何在 RLE 解码期间避免 pycocotools 中的分段错误
【发布时间】:2022-12-04 07:19:57
【问题描述】:

这是解码损坏的 RLE 的示例:

from pycocotools import mask  # pycocotools version is 2.0.2
mask.decode({'size': [1024, 1024], 'counts': "OeSOk0[l0VOaSOn0kh0cNmYO'"})

结果它失败了 Segmentation fault (core dumped)
它看起来像这样:

Python 3.6.15 (default) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> from pycocotools import mask
>>> mask.decode({'size': [1024, 1024], 'counts': "OeSOk0[l0VOaSOn0kh0cNmYO'"})
Segmentation fault (core dumped)

问题:

  1. 在将其放入 mask.decode 之前是否需要验证 RLE(运行长度编码)?
  2. (我认为这是不可能的,但仍然)是处理signal.SIGSEGV并继续执行代码的方法吗?

【问题讨论】:

    标签: python rle pycocotools


    【解决方案1】:

    这个问题通过更新解决pycocotools版本2.0.5

    【讨论】:

      猜你喜欢
      • 2020-02-29
      • 1970-01-01
      • 2022-06-16
      • 1970-01-01
      • 2021-03-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多