我有一个python应用程序,它使用tesseract检测扫描图像中的复选框,在本地机器上工作非常好,但是当我将代码与python-tesseract buildpack一起推送到Bluemix时,它无法生成输出文件,这意味着在Bluemix上没有检测到tesseract。
这是我的manifest.yml:
应用程序:
这是我的requirements.txt:
烧瓶 numpy Pillow==4.1.1 pycparser解析器 pyOpenSSL 拟解析 青蒿琥酯 python-dateutil python-迅捷客户端 比兹 PyWavelets 科学图像 枕骨 请求 matplotlib==1.4.3 opencv-python cf_deployment_tracker 特塞尔
以下是Bluemix的日志:
Traceback (most recent call last):
File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/app/.heroku/python/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "server.py", line 217, in predict_square_checkboxes
ImgOcr = image_hocr_class.ocr_hocr('temporary.png')
File "/home/vcap/app/src/image_hocr_class.py", line 39, in __init__
self.HTMLTree = xml.etree.ElementTree.parse(self.HOCRFileName).getroot()
File "/app/.heroku/python/lib/python3.6/xml/etree/ElementTree.py", line 1196, in parse
tree.parse(source, parser)
File "/app/.heroku/python/lib/python3.6/xml/etree/ElementTree.py", line 586, in parse
source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'images/8e297b93a39f1e08a490f72c8db53bf0.hocr'当pytesseract无法找到tesseract的路径时,通常会发生这种情况。不知道怎么弄到布卢米克斯的作品。有没有人有用tesseract在蓝光上工作的蟒?请帮帮忙。
发布于 2017-11-15 11:30:37
IBM为您提供了许多运行应用程序的可能性。是其中之一,但在您的情况下似乎并不合适。每当您有需要安装的依赖项时,就需要创建自定义buildpack,这可能是一个相当复杂的任务。(https://docs.cloudfoundry.org/buildpacks/custom.html)听说过Docker/Kubernetes吗?如果您有许多应用程序依赖项(比如在您的例子中是tesseract ),我建议您创建一个Kubernetes环境来构建应用程序!请看一下这些资源:https://hub.docker.com/r/tesseractshadow/tesseract4re/ index
https://stackoverflow.com/questions/47244550
复制相似问题