【发布时间】:2018-04-13 08:59:24
【问题描述】:
我正在使用带有 Ubuntu 14.04 映像的 Docker 容器,我正在尝试使用 python 包装器 tesserocr 在其中运行 tesseract-ocr。
版本详情如下:
tesseract 4.00.00alpha
leptonica-1.74.4
libjpeg 8d (libjpeg-turbo 1.3.0) : libpng 1.2.50 : libtiff 4.0.3 : zlib 1.2.8
Found AVX
Found SSE
我使用的代码是:
from tesserocr import PyTessBaseAPI
from PIL import Image
x = Image.open('image.jpg')
with PyTessBaseAPI() as api:
api.SetImage(x)
api.Recognize()
ri=api.GetIterator()
print api.GetUTF8Text()
docker内部的内存详细信息是(使用free -m):
total used free shared buffers cached
Mem: 12012 10280 1731 1 420 8738
-/+ buffers/cache: 1121 10890
Swap: 12284 64 12220
运行代码时出现以下错误:
Segmentation fault (core dumped)
当我在我的机器(没有 docker 容器)中运行它时,内存细节几乎相同,并且对于相同的图像运行良好。
什么可能导致这个问题,我该如何解决这个问题?
【问题讨论】:
标签: python docker segmentation-fault tesseract