首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用Serverless和python 3.7在AWS Lambda中打包dlib

使用Serverless和python 3.7在AWS Lambda中打包dlib
EN

Stack Overflow用户
提问于 2020-05-07 02:43:48
回答 2查看 833关注 0票数 0

我试图使用python3.7运行时的Serverless框架部署一个AWS Lambda函数,我需要将dlib打包为依赖项并在lambda函数中导入。有什么想法吗?让dlib在python3.7上工作并成功地使用Serverless框架的最简单方法是什么?蒂娅..。

更新:我已经将添加到中,我使用的是Serverless插件无服务器- python -requirements,我使用bitbucket管道进行部署,使用的是带有python和节点库的ubuntu映像。我还在管道脚本中安装了cmake,因为正如我所见,dlib需要它来编译。

管道失败的原因如下:

代码语言:javascript
运行
复制
Container 'Build' exceeded memory limit.

dlib编译以77%的速度停止,并发出以下反复出现的弃用警告,直到管道超过内存并因失败而停止:

代码语言:javascript
运行
复制
 Scanning dependencies of target dlib
.
.

 [ 77%] Building CXX object CMakeFiles/dlib_python.dir/src/other.cpp.o
    In file included from /tmp/pip-install-nx1hok9_/dlib/dlib/external/pybind11/include/pybind11/cast.h:16,
                     from /tmp/pip-install-nx1hok9_/dlib/dlib/external/pybind11/include/pybind11/attr.h:13,
                     from /tmp/pip-install-nx1hok9_/dlib/dlib/external/pybind11/include/pybind11/pybind11.h:43,
                     from /tmp/pip-install-nx1hok9_/dlib/dlib/../dlib/python/pybind_utils.h:6,
                     from /tmp/pip-install-nx1hok9_/dlib/dlib/../dlib/python.h:6,
                     from /tmp/pip-install-nx1hok9_/dlib/tools/python/src/basic.cpp:3:
    /tmp/pip-install-nx1hok9_/dlib/dlib/external/pybind11/include/pybind11/detail/internals.h:82:34: warning: ‘int PyThread_create_key()’ is deprecated [-Wdeprecated-declarations]
         decltype(PyThread_create_key()) tstate = 0; // Usually an int but a long on Cygwin64 with Python 3.x
                                      ^
    In file included from /usr/local/include/python3.7m/pystate.h:11,
                     from /usr/local/include/python3.7m/traceback.h:8,
                     from /usr/local/include/python3.7m/Python.h:119,
                     from /tmp/pip-install-nx1hok9_/dlib/dlib/external/pybind11/include/pybind11/detail/common.h:111,
                     from /tmp/pip-install-nx1hok9_/dlib/dlib/external/pybind11/include/pybind11/pytypes.h:12,
                     from /tmp/pip-install-nx1hok9_/dlib/dlib/external/pybind11/include/pybind11/cast.h:13,
                     from /tmp/pip-install-nx1hok9_/dlib/dlib/external/pybind11/include/pybind11/attr.h:13,
                     from /tmp/pip-install-nx1hok9_/dlib/dlib/external/pybind11/include/pybind11/pybind11.h:43,
                     from /tmp/pip-install-nx1hok9_/dlib/dlib/../dlib/python/pybind_utils.h:6,
                     from /tmp/pip-install-nx1hok9_/dlib/dlib/../dlib/python.h:6,
                     from /tmp/pip-install-nx1hok9_/dlib/tools/python/src/basic.cpp:3:
    /usr/local/include/python3.7m/pythread.h:95:17: note: declared here
     PyAPI_FUNC(int) PyThread_create_key(void) Py_DEPRECATED(3.7);
                     ^~~~~~~~~~~~~~~~~~~
    In file included from /tmp/pip-install-nx1hok9_/dlib/dlib/external/pybind11/include/pybind11/cast.h:16,
                     from /tmp/pip-install-nx1hok9_/dlib/dlib/external/pybind11/include/pybind11/attr.h:13,
                     from /tmp/pip-install-nx1hok9_/dlib/dlib/external/pybind11/include/pybind11/pybind11.h:43,
                     from /tmp/pip-install-nx1hok9_/dlib/dlib/../dlib/python/pybind_utils.h:6,
                     from /tmp/pip-install-nx1hok9_/dlib/dlib/../dlib/python.h:6,
                     from /tmp/pip-install-nx1hok9_/dlib/tools/python/src/basic.cpp:3:
    /tmp/pip-install-nx1hok9_/dlib/dlib/external/pybind11/include/pybind11/detail/internals.h:82:34: warning: ‘int PyThread_create_key()’ is deprecated [-Wdeprecated-declarations]
         decltype(PyThread_create_key()) tstate = 0; // Usually an int but a long on Cygwin64 with Python 3.x
                                      ^
    In file included from /usr/local/include/python3.7m/pystate.h:11,

在这里输入代码

EN

Stack Overflow用户

回答已采纳

发布于 2020-05-08 20:16:48

好的,我通过将管道大小增加到2倍来解决这个问题,它成功了。

票数 0
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61648983

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档