使用AWS Lambda函数找不到可用的临时目录

时间:2019-07-03 08:45:32

标签: python amazon-web-services aws-lambda mlflow

我正在尝试在mlflow中使用aws lambda function下载模型,如下所述:https://www.mlflow.org/docs/latest/tracking.html#referencing-artifacts

但是会引发以下错误:

  File "/tmp/mlflow-api-server/mlflow/tracking/artifact_utils.py", line 66, in _download_artifact_from_uri
  artifact_path=artifact_path, dst_path=output_path)
  File "/tmp/mlflow-api-server/mlflow/store/artifact_repo.py", line 94, in download_artifacts
  dst_path = tempfile.mkdtemp()
  File "/var/lang/lib/python3.6/tempfile.py", line 360, in mkdtemp
  prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)
  File "/var/lang/lib/python3.6/tempfile.py", line 130, in _sanitize_params
  dir = gettempdir()
  File "/var/lang/lib/python3.6/tempfile.py", line 298, in gettempdir
  tempdir = _get_default_tempdir()
  File "/var/lang/lib/python3.6/tempfile.py", line 233, in _get_default_tempdir
  dirlist)
FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp']

model.pkl应该下载的sklearn mlflow文件有627字节,而aws lambda的限制应该是512 MB,应该有足够的空间。

0 个答案:

没有答案