aws / amazon-sagemaker-examples

Example 📓 Jupyter notebooks that demonstrate how to build, train, and deploy machine learning models using 🧠 Amazon SageMaker.
https://sagemaker-examples.readthedocs.io
Apache License 2.0
10.14k stars 6.78k forks source link

[Bug Report]Error in example notebook Amazon_Tensorflow_Object_Detection #4760

Open duane-edgington opened 1 month ago

duane-edgington commented 1 month ago

Link to the notebook amazon-sagemaker-examples/ archived /Amazon_Tensorflow_Object_Detection.ipynb Describe the bug TypeError: the JSON object must be str, bytes or bytearray, not dict thrown using default parameters/selections

Screenshot 2024-09-30 at 1 59 55 PM

at normalized_boxes, classes_names, confidences = parse_response(query_response)

To reproduce A clear, step-by-step set of instructions to reproduce the bug. open notebook tensorflow-od1-ssd-resnet50-v1-fpn-1024x1024-coco17-tpu-8-SDK.ipynb step through the notebook executing each line

Logs If applicable, add logs to help explain your problem. You may also attach an .ipynb file to this issue if it includes relevant logs or output. tensorflow-od1-ssd-resnet50-v1-fpn-1024x1024-coco17-tpu-8-SDK.ipynb.txt

duane-edgington commented 1 month ago

I fixed the bug in my notebook with the following code

query_response = query(model_predictor, NAXOS_TAVERNA) json_string = json.dumps(query_response) encoded_bytes = json_string.encode('utf-8') final_query_response = bytearray(encoded_bytes) normalized_boxes, classes_names, confidences = parse_response(final_query_response)