Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix shapes error if images was a list. #2173

Merged
merged 4 commits into from
Nov 20, 2023

Conversation

divyashreepathihalli
Copy link
Collaborator

Fixing error in this guide - classification_with_keras_cv

AttributeError                            Traceback (most recent call last)
[<ipython-input-3-79c475acdf18>](https://localhost:8080/#) in <cell line: 4>()
      2 image = keras.utils.load_img(filepath)
      3 image = np.array(image)
----> 4 keras_cv.visualization.plot_image_gallery(
      5     [image], rows=1, cols=1, value_range=(0, 255), show=True, scale=4
      6 )

[/usr/local/lib/python3.10/dist-packages/keras_cv/src/visualization/plot_image_gallery.py](https://localhost:8080/#) in plot_image_gallery(images, value_range, scale, rows, cols, path, show, transparent, dpi, legend_handles)
    130     else:
    131         batch_size = (
--> 132             images.shape[0] if len(images.shape) == 4 else 1
    133         )  # batch_size from np.array or single image
    134 

AttributeError: 'list' object has no attribute 'shape'

Copy link
Collaborator

@sampathweb sampathweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sampathweb sampathweb merged commit 1fbfe33 into keras-team:master Nov 20, 2023
6 of 9 checks passed
yuvraj-wale pushed a commit to yuvraj-wale/keras-cv that referenced this pull request Feb 8, 2024
* fix shapes error  if images was a list.

* fix tuple error

* revert previous commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants