繁体   English   中英

Sagemaker 培训作业失败“”FileNotFoundError:[Errno 2] 没有这样的文件或目录:'/opt/ml/input/data/training/annotations.json'”

[英]Sagemaker training job fails ""FileNotFoundError: [Errno 2] No such file or directory: '/opt/ml/input/data/training/annotations.json'"

在 AWS Sagemaker 中尝试使用 Quick Start model 时,专门针对 Object 检测时,所有微调模型都无法训练。

我正在尝试微调SSD Mobil.net V1 FPN 640x640 COCO '17 model。

注释和图像被接受,但在初始化训练 session 后,训练作业无法找到特定文件: FileNotFoundError: [Errno 2] No such file or directory: '/opt/ml/input/data/training/annotations.json

给出的 S3 目录遵循所需的模板,为简单起见,使用 1 个图像示例:

images/
  abc.png
annotations/
  abc.json

返回以下堆栈跟踪:

We encountered an error while training the model on your data. AlgorithmError: ExecuteUserScriptError:
ExitCode 1
ErrorMessage "FileNotFoundError: [Errno 2] No such file or directory: '/opt/ml/input/data/training/annotations.json'
"
Command "/usr/local/bin/python3.9 transfer_learning.py --batch_size 3 --beta_1 0.9 --beta_2 0.999 --early_stopping False --early_stopping_min_delta 0 --early_stopping_patience 5 --epochs 5 --epsilon 1e-7 --initial_accumulator_value 0.1 --learning_rate 0.001 --model-artifact-bucket jumpstart-cache-prod-us-east-1 --model-artifact-key tensorflow-training/train-tensorflow-od1-ssd-mobilenet-v1-fpn-640x640-coco17-tpu-8.tar.gz --momentum 0.9 --optimizer adam --reinitialize_top_layer Auto --rho 0.95 --train_only_top_layer False", exit code: 1

可能存在一个内部错误,即输入注释的映射未转换并放置到训练作业容器中的此目录中?

快速启动解决方案中的预期输入数据 object 检测算法具有单个 annotations.json 文件,其中包含所有图像的注释。

它应该是一个带有键"images""annotations"的字典。 "images"键的值应该是一个条目列表,每个条目对应一个格式为{"file_name": image_name, "height": height, "width": width, "id": image_id}. "annotations"键的值应该是一个条目列表,每个边界框的形式为{"image_id": image_id, "bbox": [xmin, ymin, xmax, ymax], "category_id": bbox_label}.

目录结构是

   images 
      abc.png
      def.png
   annotations.json

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM