Closed Philmod closed 1 year ago
From what I see [image]
should be a tf.Tensor
, np.array
or a tf.data.Dataset
as written in the docs, not a list. Try np.array(image)
and let me know if it works.
I followed the first example from this page and it does use np.array
:
The example is a little old probably, it should be fixed nonetheless addressing the API change, but for now you can just do:
image = np.array(image)
keras_cv.visualization.plot_image_gallery(
image, rows=1, cols=1, value_range=(0, 255), show=True, scale=4,
)
Apparently, as the intepreter is telling you, the visualization function wants a batched input for the "images" parameter. Just do:
image = np.array(image)
image = np.expand_dims(image, 0)
keras_cv.visualization.plot_image_gallery(
image, rows=1, cols=1, value_range=(0, 255), show=True, scale=4
)
Thanks. Anyway, that was a breaking change in 0.5.1
vs 0.5.0
imho.
Please file an issue on the guide to update.
+1 -- this change did break our example, but it's because the example is wrong.
Thanks for the report -- if you open an issue on keras.io we can get the example updated
This issue belongs on keras.io, so I'm going to close this copy of it.
This line of code I was using with the version
0.5.0
is broken with0.5.1
:Here is the error: