While using the Open Source Object Detection ML Skill I receive the following error for some images:
"> KeyError: ‘RGBA’
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “/home/aicenter/.local/lib/python3.8/site-packages/UiPath_core/plugin.py”, line 156, in _model_predict
output = self.model.predict(processed_data)
File “/microservice/main.py”, line 59, in predict
images.save(image_path)
File “/home/aicenter/.local/lib/python3.8/site-packages/PIL/Image.py”, line 2320, in save
save_handler(self, fp, filename)
File “/home/aicenter/.local/lib/python3.8/site-packages/PIL/JpegImagePlugin.py”, line 632, in _save
raise OSError(f"cannot write mode {im.mode} as JPEG") from e
OSError: cannot write mode RGBA as JPEG"
Should I add some logic to detect the image properties and convert it to another format before processing? or there is any kind of parameter to set?
The error is raised for some images not all of them. It seems it can not read the image or it is expected a specific property.
By the way I’ve tested the same set of images with UiPath’s ImageClassification package and it did not raise any errors.