Inference an image
We will try to inference the following dog image.

First, download the image.
Upload an image to S3
Click "S3" in "Services" to enter the console of S3.

2. Click the name of the bucket, "cslab-images-{your student id}" in the list.

3. Click "Upload".

4. Click "Add files" and select the dog image.


5. Click "Upload".
6. After that, you can find the image in the folder of the bucket.

Check the result on DynamoDB
Click "DynamoDB" in "Services" to enter the console of DynamoDB.

2. Click "Tables".

3. Click "classifciation_resut".

4. Click "View Items" on the top-right corner.

5. You can find a new row with the image file name and inference result "golden retriever".

Check the execution log in CloudWatch
Click "CloudWatch" in "Services".

2. Click "Log groups" in the sidebar of "Logs".

3. Click "/aws/lambda/Image-classification".
4. You can read the log to debug your lambda program.


5. Above is the screenshot of successful execution with no error occurred. While if we set the "S3_MODEL_PATH" to an invalid path, the log would look as following:

6. Unfold the error message and we can find the error is raised by function "s3_client.download_file", indicating the path to model is incorrect.

Last updated
Was this helpful?