1

使用 Docker 映像在 AWS 上测试我的 lambda 函数时出现以下错误。该模型是一个简单的transformers分类模型。测试在本地运行良好。

[ERROR] OSError: [Errno 30] Read-only file system: '/home/sbx_user1051'
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/usr/local/lib/python3.6/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "app.py", line 28, in <module>
    model = torch.load(PATH)
  File "/function/torch/serialization.py", line 594, in load
    return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
  File "/function/torch/serialization.py", line 853, in _load
    result = unpickler.load()
  File "/function/simpletransformers/classification/__init__.py", line 1, in <module>
    from simpletransformers.classification.classification_model import ClassificationModel
  File "/function/simpletransformers/classification/classification_model.py", line 37, in <module>
    from transformers.optimization import (
  File "/function/transformers/__init__.py", line 218, in <module>
    from .integrations import (  # isort:skip
  File "/function/transformers/integrations.py", line 43, in <module>
    import wandb
  File "/function/wandb/__init__.py", line 118, in <module>
    api = InternalApi()
  File "/function/wandb/apis/internal.py", line 17, in __init__
    self.api = InternalApi(*args, **kwargs)
  File "/function/wandb/sdk/internal/internal_api.py", line 82, in __init__
    load_settings=load_settings, root_dir=self.default_settings.get("root_dir")
  File "/function/wandb/old/settings.py", line 25, in __init__
    self._global_settings.read([Settings._global_path()])
  File "/function/wandb/old/settings.py", line 105, in _global_path
    util.mkdir_exists_ok(config_dir)
  File "/function/wandb/util.py", line 641, in mkdir_exists_ok
    os.makedirs(path)
  File "/usr/local/lib/python3.6/os.py", line 210, in makedirs
    makedirs(head, mode, exist_ok)
  File "/usr/local/lib/python3.6/os.py", line 210, in makedirs
    makedirs(head, mode, exist_ok)
  File "/usr/local/lib/python3.6/os.py", line 220, in makedirs
    mkdir(name, mode)

我认为 simpletransformers 正在尝试写入 os. 有什么解决方法吗?

4

1 回答 1

0

使用 simpletransformer 时,我在 NER 模型中遇到了同样的问题。我不得不恢复到变压器,它工作正常。

于 2021-03-08T07:53:35.100 回答