本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
以下工作定義範例測試 使用 GPU 工作負載 AMI 中所述的 GPU 工作負載 AMI 是否正確設定。此範例任務定義會從 GitHub 執行 TensorFlow 深度 MNIST 分類器範例
{
"containerProperties": {
"image": "tensorflow/tensorflow:1.8.0-devel-gpu",
"resourceRequirements": [
{
"type": "MEMORY",
"value": "32000"
},
{
"type": "VCPU",
"value": "8"
}
],
"command": [
"sh",
"-c",
"cd /tensorflow/tensorflow/examples/tutorials/mnist; python mnist_deep.py"
]
},
"type": "container",
"jobDefinitionName": "tensorflow_mnist_deep"
}
您可以建立名為前述 JSON 文字的檔案,tensorflow_mnist_deep.json
然後使用下列命令註冊 AWS Batch 任務定義:
aws batch register-job-definition --cli-input-json file://tensorflow_mnist_deep.json