Reputation: 48956
So, this part of an autoencoder Keras code, which can be seen, here, tries to reconstruct the encoded image:
decoded_images = decoder.predict(encoded_images)
I'm trying after that to save the decoded images, as follows:
for i in range(len(decoded_images)):
cv2.imwrite(results_directory + '/' + str(i),decoded_images[i])
I however get the following error:
cv2.error: /dev/shm/ebuser/OpenCV/2.4.13.3/gmkl-2016.4/opencv-2.4.13.3/modules/highgui/src/loadsave.cpp:275: error: (-2) could not find a writer for the specified extension in function imwrite
Why is that? How can I solve this error?
Upvotes: 0
Views: 264
Reputation: 48956
I noticed that I simply need to add an extension, for instanse .jpg
, as follows:
cv2.imwrite(results_directory + '/' + str(i) + '.jpg',decoded_images[i])
Upvotes: 2