我试图使用python3.7运行时的Serverless框架部署一个AWS Lambda函数,我需要将dlib打包为依赖项并在lambda函数中导入。有什么想法吗?让dlib在python3.7上工作并成功地使用Serverless框架的最简单方法是什么?蒂娅..。
更新:我已经将添加到中,我使用的是Serverless插件无服务器- python -requirements,我使用bitbucket管道进行部署,使用的是带有python和节点库的ubuntu映像。我还在管道脚本中安装了cmake,因为正如我所见,dlib需要它来编译。
管道失败的原因如下:
Container 'Build' exceeded memory limit.dlib编译以77%的速度停止,并发出以下反复出现的弃用警告,直到管道超过内存并因失败而停止:
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,
在这里输入代码
发布于 2020-05-08 20:16:48
好的,我通过将管道大小增加到2倍来解决这个问题,它成功了。
https://stackoverflow.com/questions/61648983
复制相似问题