Tensorflow 如何在SageMaker上托管的MobileNet SSD模型上运行对象检测预测

Tensorflow 如何在SageMaker上托管的MobileNet SSD模型上运行对象检测预测,tensorflow,object-detection,amazon-sagemaker,mobilenet,Tensorflow,Object Detection,Amazon Sagemaker,Mobilenet,我使用AWS SageMaker训练了一个MobileNet v1 SSD模型,它训练得非常完美。我有一个导出/伺服/xxx/保存的_图(一个从检查点派生的tflite模型在物联网设备上工作得非常好)。该模型作为端点部署在SageMaker上,没有问题。我的问题是,我不知道如何将图像馈送到模型端点。(这大概与询问如何将数据输入到服务模型中相同?) 当我查询模型(如下)时,我看到输入签名是“serialized_example”。所以,我假设我需要一个序列化的示例。那就是我才干枯竭的地方 我需要帮

我使用AWS SageMaker训练了一个MobileNet v1 SSD模型,它训练得非常完美。我有一个导出/伺服/xxx/保存的_图(一个从检查点派生的tflite模型在物联网设备上工作得非常好)。该模型作为端点部署在SageMaker上,没有问题。我的问题是,我不知道如何将图像馈送到模型端点。(这大概与询问如何将数据输入到服务模型中相同?)

当我查询模型(如下)时,我看到输入签名是“serialized_example”。所以,我假设我需要一个序列化的示例。那就是我才干枯竭的地方

我需要帮助理解如何将jpg文件转换为序列化示例。或者如何使用TFR记录

saved_model_cli show --dir {MODEL_PATH} --tag_set serve --signature_def tensorflow/serving/predict
收益率(我省略了输出):

我有一个数据集,但不知道如何获得正确的类-

raw_dataset = tf.data.TFRecordDataset(tfrecord_file_list)
example_decoder = TfExampleDecoder()
decoded_dataset = raw_dataset.map(example_decoder.decode)
如果我在解码的数据集中进行枚举,我如何将数据输入到模型中

for n, e in enumerate(decoded_dataset.take(4)):
   what do I do with e - which looks like:

<DatasetV1Adapter shapes: {image: (?, ?, 3), source_id: (), key: (), filename: (), groundtruth_boxes: (?, 4), groundtruth_area: (?,), groundtruth_is_crowd: (?,), groundtruth_difficult: (?,), groundtruth_group_of: (?,), groundtruth_weights: (?,), groundtruth_classes: (?,), groundtruth_image_classes: (?,), original_image_spatial_shape: (2,)}, types: {image: tf.uint8, source_id: tf.string, key: tf.string, filename: tf.string, groundtruth_boxes: tf.float32, groundtruth_area: tf.float32, groundtruth_is_crowd: tf.bool, groundtruth_difficult: tf.int64, groundtruth_group_of: tf.int64, groundtruth_weights: tf.float32, groundtruth_classes: tf.int64, groundtruth_image_classes: tf.int64, original_image_spatial_shape: tf.int32}>
枚举中n,e的
(解码的_数据集,取(4)):
我该如何处理e-它看起来像:

我将不谈这个话题,但需要提问。有没有关于使用SageMaker培训mobilenet SSD的指南?我将不谈这个话题,但需要问一下。是否有任何指南可用于培训mobilenet SSD和SageMaker?
for n, e in enumerate(decoded_dataset.take(4)):
   what do I do with e - which looks like:

<DatasetV1Adapter shapes: {image: (?, ?, 3), source_id: (), key: (), filename: (), groundtruth_boxes: (?, 4), groundtruth_area: (?,), groundtruth_is_crowd: (?,), groundtruth_difficult: (?,), groundtruth_group_of: (?,), groundtruth_weights: (?,), groundtruth_classes: (?,), groundtruth_image_classes: (?,), original_image_spatial_shape: (2,)}, types: {image: tf.uint8, source_id: tf.string, key: tf.string, filename: tf.string, groundtruth_boxes: tf.float32, groundtruth_area: tf.float32, groundtruth_is_crowd: tf.bool, groundtruth_difficult: tf.int64, groundtruth_group_of: tf.int64, groundtruth_weights: tf.float32, groundtruth_classes: tf.int64, groundtruth_image_classes: tf.int64, original_image_spatial_shape: tf.int32}>