Mode write file

Hello, I have the following error that I cannot resolve:
“Could not find a format to write the specified file in %s mode” % modename
ValueError: Could not find a format to write the specified file in single-image mode

the code is :
for f in jpgFiles:
image=misc.imread(f)
img=misc.imresize(image,(256,256,3))
print(img.shape)
pred=pipeline.predict(img)
output=visualizer(img,pred)
imageio.imwrite(args.outputPath,output)

Help please

This error seems to be raised by imageio, which cannot save the output in a floating point format, so you might need to transform it to an “image format” in uint8 before calling imageio.imwrite.