I was working with custom dataset training with yolonas
, but now it is giving me error of unidentified image error. I verified my path is correct and format is also correct and previously it was giving result perfectly but suddenly it is giving me this error:
UnidentifiedImageError Traceback (most recent call last)
in <cell line: 1>()
----> 1 best_model.predict("img2.jpg")
8 frames
/usr/local/lib/python3.10/dist-packages/super_gradients/training/models/detection_models/customizable_detector.py in predict(self, images, iou, conf, batch_size, fuse_model, skip_image_resizing, nms_top_k, max_predictions, multi_label_per_box, class_agnostic_nms, fp16)
306 fp16=fp16,
307 )
--> 308 return pipeline(images, batch_size=batch_size) # type: ignore
309
310 def predict_webcam(
/usr/local/lib/python3.10/dist-packages/super_gradients/training/pipelines/pipelines.py in call(self, inputs, batch_size)
118 return self.predict_video(inputs, batch_size)
119 elif check_image_typing(inputs):
--> 120 return self.predict_images(inputs, batch_size)
121 else:
122 raise ValueError(f"Input {inputs} not supported for prediction.")
/usr/local/lib/python3.10/dist-packages/super_gradients/training/pipelines/pipelines.py in predict_images(self, images, batch_size)
131 from super_gradients.training.utils.media.image import load_images
132
--> 133 images = load_images(images)
134
135 result_generator = self._generate_prediction_result(images=images, batch_size=batch_size)
/usr/local/lib/python3.10/dist-packages/super_gradients/training/utils/media/image.py in load_images(images)
32 :return: List of images as numpy arrays. If loaded from string, the image will be returned as RGB.
33 """
---> 34 return [image for image in generate_image_loader(images=images)]
35
36
/usr/local/lib/python3.10/dist-packages/super_gradients/training/utils/media/image.py in (.0)
32 :return: List of images as numpy arrays. If loaded from string, the image will be returned as RGB.
33 """
---> 34 return [image for image in generate_image_loader(images=images)]
35
36
/usr/local/lib/python3.10/dist-packages/super_gradients/training/utils/media/image.py in generate_image_loader(images)
66 yield load_image(image=image)
67 else:
---> 68 yield load_image(image=images)
69
70
/usr/local/lib/python3.10/dist-packages/super_gradients/training/utils/media/image.py in load_image(image, input_image_channels)
120 return load_np_image_from_pil(image)
121 elif isinstance(image, str):
--> 122 image = load_pil_image_from_str(image_str=image)
123 return load_np_image_from_pil(image)
124 else:
/usr/local/lib/python3.10/dist-packages/super_gradients/training/utils/media/image.py in load_pil_image_from_str(image_str)
139 return PIL.Image.open(io.BytesIO(response.content))
140 else:
--> 141 return PIL.Image.open(image_str)
142
143
/usr/local/lib/python3.10/dist-packages/PIL/Image.py in open(fp, mode, formats)
3281 continue
3282 except BaseException:
-> 3283 if exclusive_fp:
3284 fp.close()
3285 raise
UnidentifiedImageError: cannot identify image file 'img2.jpg'
But for the line with train_data.dataset._load_image("img 2.jpg")
it is opening.