Code snippet giving the error:
for i in range(masks.shape[0]):
imsave(os.path.join(PATH_TO_SAVE, f"prediction_{(i+1):04d}"), masks[i])
Error message:
"ValueError: Could not find a backend to open `my_path` with iomode `wi`"
Code snippet giving the error:
for i in range(masks.shape[0]):
imsave(os.path.join(PATH_TO_SAVE, f"prediction_{(i+1):04d}"), masks[i])
Error message:
"ValueError: Could not find a backend to open `my_path` with iomode `wi`"
In the filename of the imsave argument, you have to mention the image type, for example, bmp
or tiff
Corrected code snippet:
for i in range(masks.shape[0]):
imsave(os.path.join(PATH_TO_SAVE, f"prediction_{(i+1):04d}.bmp"), masks[i])enter code here