diff --git a/library/train_util.py b/library/train_util.py index c1b02b8c..33af29f2 100644 --- a/library/train_util.py +++ b/library/train_util.py @@ -2496,7 +2496,7 @@ def load_image(image_path, alpha=False): try: with Image.open(image_path) as image: if getattr(image, "is_animated", False): - raise Exception( f"{image_path} is animated" ) + logger.warning( f"{image_path} is animated" ) # Convert image to sRGB if "PIL.ImageCms" in sys.modules: @@ -2508,7 +2508,7 @@ def load_image(image_path, alpha=False): ImageCms.profileToProfile(image, src_profile, srgb_profile, inPlace=True) image.info["icc_profile"] = ImageCms.ImageCmsProfile(srgb_profile).tobytes() except Exception as e: - raise Exception( f"Could not convert {image_path} to sRGB: {src_profile.profile.model} {src_profile.profile.profile_description}\n{e}" ) + logger.warning( f"Could not convert {image_path} to sRGB: {src_profile.profile.model} {src_profile.profile.profile_description}\n{e}" ) if alpha: if not image.mode == "RGBA":