awslabs / multi-model-server

Multi Model Server is a tool for serving neural net models for inference
Apache License 2.0
995 stars 231 forks source link

Cannot run SSD inference with a SageMaker trained model #893

Closed sergiuionescu closed 4 years ago

sergiuionescu commented 4 years ago

Hello, I have followed the SSD Example(https://github.com/awslabs/multi-model-server/tree/master/examples/ssd ) in hope i could run a SageMaker trained Model locally. The example works like a charm, but when changing the mymodel-symbols.json and mymodel-0000.params with the ones obtained from the SageMaker guilde here https://github.com/awslabs/amazon-sagemaker-examples/blob/master/introduction_to_amazon_algorithms/object_detection_pascalvoc_coco/object_detection_image_json_format.ipynb

I get the following error: 2020-01-27 23:29:38,585 [INFO ] W-9000-classyfy-stdout com.amazonaws.ml.mms.wlm.WorkerLifeCycle - RuntimeError: simple_bind error. Arguments: 2020-01-27 23:29:38,585 [INFO ] W-9000-classyfy-stdout com.amazonaws.ml.mms.wlm.WorkerLifeCycle - data: (1, 3, 512, 512) 2020-01-27 23:29:38,585 [INFO ] W-9000-classyfy-stdout com.amazonaws.ml.mms.wlm.WorkerLifeCycle - Error in operator multibox_target: [23:29:38] src/operator/contrib/./multibox_target-inl.h:224: Check failed: lshape.ndim() == 3 (-1 vs. 3) : Label should be [batch, num_labels, label_width] tensor 2020-01-27 23:29:38,585 [INFO ] W-9000-classyfy-stdout com.amazonaws.ml.mms.wlm.WorkerLifeCycle - Stack trace:

Should SageMaker trained models be compatible with multi-model-server ssd inference?

Thanks.

sergiuionescu commented 4 years ago

Found my answer here: https://github.com/aws-samples/amazon-sagemaker-aws-greengrass-custom-object-detection-model/blob/master/training/03_local_inference_post_training.ipynb

The Sagemaker model output is a checkpoint used for training, the model needs to be deployed for inference.