選取您的 Cookie 偏好設定

我們使用提供自身網站和服務所需的基本 Cookie 和類似工具。我們使用效能 Cookie 收集匿名統計資料,以便了解客戶如何使用我們的網站並進行改進。基本 Cookie 無法停用,但可以按一下「自訂」或「拒絕」以拒絕效能 Cookie。

如果您同意,AWS 與經核准的第三方也會使用 Cookie 提供實用的網站功能、記住您的偏好設定,並顯示相關內容,包括相關廣告。若要接受或拒絕所有非必要 Cookie,請按一下「接受」或「拒絕」。若要進行更詳細的選擇,請按一下「自訂」。

使用 modeltransform 命令進行模型轉換

焦點模式
使用 modeltransform 命令進行模型轉換 - Amazon Neptune

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

您可以使用 Neptune ML modeltransform 命令來建立模型轉換工作、檢查其狀態、停止該工作,或列出所有作用中的模型轉換工作。

使用 Neptune ML modeltransform 命令建立模型轉換工作

用於建立增量轉換工作而不需模型重新訓練的 Neptune ML modeltransform 命令如下所示:

curl \ -X POST https://(your Neptune endpoint)/ml/modeltransform -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique model-transform job ID)", "dataProcessingJobId" : "(the job-id of a completed data-processing job)", "mlModelTrainingJobId" : "(the job-id of a completed model-training job)", "modelTransformOutputS3Location" : "s3://(your Amazon S3 bucket)/neptune-model-transform" }'

從已完成的 SageMaker AI 訓練任務建立任務的 Neptune ML modeltransform命令如下所示:

curl \ -X POST https://(your Neptune endpoint)/ml/modeltransform -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique model-transform job ID)", "trainingJobName" : "(name of a completed SageMaker AI training job)", "modelTransformOutputS3Location" : "s3://(your Amazon S3 bucket)/neptune-model-transform", "baseProcessingInstanceType" : "" }'

用於建立一個工作,使用自訂模型實作的 Neptune ML modeltransform 命令如下所示:

curl \ -X POST https://(your Neptune endpoint)/ml/modeltransform -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique model-training job ID)", "trainingJobName" : "(name of a completed SageMaker AI training job)", "modelTransformOutputS3Location" : "s3://(your Amazon S3 bucket)/neptune-model-transform/" "customModelTransformParameters" : { "sourceS3DirectoryPath": "s3://(your Amazon S3 bucket)/(path to your Python module)", "transformEntryPointScript": "(your transform script entry-point name in the Python module)" } }'
用於建立 modeltransform 工作的參數
  • id – (選用) 新工作的唯一識別符。

    類型:字串 預設值:自動產生的 UUID。

  • dataProcessingJobId – 已完成資料處理工作的工作 ID。

    類型:字串

    附註:您必須同時包含 dataProcessingJobIdmlModelTrainingJobIdtrainingJobName

  • mlModelTrainingJobId – 已完成模型訓練工作的工作 ID。

    類型:字串

    附註:您必須同時包含 dataProcessingJobIdmlModelTrainingJobIdtrainingJobName

  • trainingJobName – 已完成的 SageMaker AI 訓練任務的名稱。

    類型:字串

    注意:您必須同時包含 dataProcessingJobIdmlModelTrainingJobId 參數或包含 trainingJobName 參數。

  • sagemakerIamRoleArn – (選用) SageMaker AI 執行的 IAM 角色 ARN。

    類型:字串 注意:這必須列示在您的資料庫叢集參數群組中,否則會發生錯誤。

  • neptuneIamRoleArn – (選用) IAM 角色的 ARN,提供對 SageMaker AI 和 Amazon S3 資源的 Neptune 存取權。

    類型:字串 注意:這必須列示在您的資料庫叢集參數群組中,否則會發生錯誤。

  • customModelTransformParameters – (選用) 使用自訂模型進行模型轉換的組態資訊。customModelTransformParameters 物件包含下列欄位,其具有的值必須與訓練工作中儲存的模型參數相容:

    • sourceS3DirectoryPath – (必要) 此路徑通往實作您模型之 Python 模組所在的 Amazon S3 位置。這必須指向有效的現有 Amazon S3 位置,其中至少包含訓練指令碼、轉換指令碼和 model-hpo-configuration.json 檔案。

    • transformEntryPointScript – (選用) 指令碼模組中的進入點名稱,該指令碼應在識別了超參數搜尋中的最佳模型之後執行,以計算模型部署所需的模型成品。它應該能夠在沒有命令列參數的情況下執行。

      預設transform.py

  • baseProcessingInstanceType – (選用) 用於準備和管理 ML 模型訓練的 ML 執行個體類型。

    類型:字串 注意:這是根據記憶體需求選擇的 CPU 執行個體,用於處理轉換資料和模型。請參閱 選取執行個體進行模型訓練和模型轉換

  • baseProcessingInstanceVolumeSizeInGB – (選用) 訓練執行個體的磁碟區大小。輸入資料和輸出模型都會儲存在磁碟上,因此磁碟區大小必須大到足以保留這兩個資料集。

    類型:整數。預設0

    備註:如果未指定或指定 0,Neptune ML 會根據資料處理步驟中產生的建議選取磁碟區大小。請參閱 選取執行個體進行模型訓練和模型轉換

  • subnets – (選用) Neptune VPC 中子網路的 ID。

    類型:字串清單。預設值none

  • securityGroupIds – (選用) VPC 安全群組 ID。

    類型:字串清單。預設值none

  • volumeEncryptionKMSKey – (選用) SageMaker AI 用來加密連接到執行轉換任務之 ML 運算執行個體之儲存磁碟區上的資料 AWS Key Management Service (AWS KMS) 金鑰。

    類型:字串 預設值none

  • enableInterContainerTrafficEncryption – (選用) 在訓練或超參數調校工作中啟用或停用容器間流量加密。

    類型:布林值。預設值true

    注意

    enableInterContainerTrafficEncryption 參數僅適用於引擎版本 1.2.0.2.R3

  • s3OutputEncryptionKMSKey – (選用) SageMaker AI 用來加密處理任務輸出的 AWS Key Management Service (AWS KMS) 金鑰。

    類型:字串 預設值none

使用 Neptune ML modeltransform 命令取得模型轉換工作的狀態

工作狀態的範例 Neptune ML modeltransform 命令如下所示:

curl -s \ "https://(your Neptune endpoint)/ml/modeltransform/(the job ID)" \ | python -m json.tool
modeltransform 工作狀態的參數
  • id – (必要) 模型轉換工作的唯一識別符。

    類型:字串

  • neptuneIamRoleArn – (選用) IAM 角色的 ARN,提供對 SageMaker AI 和 Amazon S3 資源的 Neptune 存取權。

    類型:字串 注意:這必須列示在您的資料庫叢集參數群組中,否則會發生錯誤。

使用 Neptune ML modeltransform 命令停止模型轉換工作

用於停止工作的範例 Neptune ML modeltransform 命令如下所示:

curl -s \ -X DELETE "https://(your Neptune endpoint)/ml/modeltransform/(the job ID)"

或如下所示:

curl -s \ -X DELETE "https://(your Neptune endpoint)/ml/modeltransform/(the job ID)?clean=true"
modeltransform 停止工作的參數
  • id – (必要) 模型轉換工作的唯一識別符。

    類型:字串

  • neptuneIamRoleArn – (選用) IAM 角色的 ARN,提供對 SageMaker AI 和 Amazon S3 資源的 Neptune 存取權。

    類型:字串 注意:這必須列示在您的資料庫叢集參數群組中,否則會發生錯誤。

  • clean – (選用) 此旗標指定在工作停止時應刪除所有 Amazon S3 成品。

    類型:布林值。預設FALSE

使用 Neptune ML modeltransform 命令列出作用中的模型轉換工作

用於列出作用中工作的範例 Neptune ML modeltransform 命令如下所示:

curl -s "https://(your Neptune endpoint)/ml/modeltransform" | python -m json.tool

或如下所示:

curl -s "https://(your Neptune endpoint)/ml/modeltransform?maxItems=3" | python -m json.tool
modeltransform 列出工作的參數
  • maxItems – (選用) 要傳回的項目數上限。

    類型:整數。預設10允許的最大值1024

  • neptuneIamRoleArn – (選用) IAM 角色的 ARN,提供對 SageMaker AI 和 Amazon S3 資源的 Neptune 存取權。

    類型:字串 注意:這必須列示在您的資料庫叢集參數群組中,否則會發生錯誤。

隱私權網站條款Cookie 偏好設定
© 2025, Amazon Web Services, Inc.或其附屬公司。保留所有權利。