Problem with reading jpg image in Sagemaker, imageclassification algorithm

0

Dears,

I created a sagemaker job but I see the following error:

[01/06/2023 11:29:21 ERROR 140033245599552] Customer Error: imread read blank (None) image for file: /opt/ml/input/data/train/s3://dbimgraces/output/af/af05.jpg

As far as I can see from my label file, the location is fine and the image also looks fine. Is any problem with the imread itself?

Enter image description here

  • Can you provide more information on how you are creating the estimator and passing the data. Looks like the data path the script is reading is wrong.

  • @arun tnx for your comment. I am not sure what you mean by estimator but I pass the data via S3 location with S3 data type S3prefix and s3 data distribution type:FullyReplicate. Actually, two channel are created for training/validation and two more channels for lables for training and validation.

1 Answer
0

Not sure if you are using a sample code or writing on your own. If you can share the details, that would be helpful.

If you are using Image Classification - MXNet, the SageMaker Image Classification algorithm supports both RecordIO (application/x-recordio) and image (image/png, image/jpeg, and application/x-image) content types for training in file mode, and supports the RecordIO (application/x-recordio) content type for training in pipe mode. However, you can also train in pipe mode using the image files (image/png, image/jpeg, and application/x-image), without creating RecordIO files, by using the augmented manifest format.

Reference : https://docs.aws.amazon.com/sagemaker/latest/dg/image-classification.html

profile pictureAWS
EXPERT
answered a year ago
  • Dear @aws-user-Nitin, tnx for your comment. No I use Image Classification - MXNet, the SageMaker Image Classification algorithm itself. I havent impelement any coding yet. I also tested with Pipe and (application/x-recordio and application/x-image ) and it still do not work. You can contact me for more demonstation via skype/teams greencomputinguae at g mail dot c@m

    with leave type for channel emtpy as optional:

    ClientError: Unable to initialize the algorithm. ContentType for channel 'train_lst' is empty. Please set content type for channel 'train_lst'. (caused by KeyError) Caused by: 'train_lst', exit code: 2

    with setting type for channel application/x-image: ClientError: ContentType must be specified for train channel., exit code: 2

    By setting to application/x-recordio ClientError: Invalid RecordIO format. Please make sure that the RecordIO files are not corrupted. , exit code: 2

    By setting to application/x-image:

    ClientError: Invalid RecordIO format. Please make sure that the RecordIO files are not corrupted. , exit code: 2


    It is strange, if it mentions the field is optional, then why user force to set it?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions