Skip to content

Error visualizing results in generate_components.py : TypeError: Invalid shape (64, 64, 1) for image data #18

@himmetozcan

Description

@himmetozcan

When I run the script "generate_components.py" I get this error below. Can you help?

Traceback (most recent call last):
  File "generate_components.py", line 112, in <module>
    visualize_alpha(f'{sample_outdir}/depth_{component_index}_{component_name}.jpg', depths[component_index][0])
  File "generate_components.py", line 43, in visualize_alpha
    fig = plt.matshow(tensor, cmap="inferno")
  File "/usr/local/lib/python3.7/dist-packages/matplotlib/pyplot.py", line 2116, in matshow
    im = ax.matshow(A, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/matplotlib/axes/_axes.py", line 7791, in matshow
    im = self.imshow(Z, **kw)
  File "/usr/local/lib/python3.7/dist-packages/matplotlib/__init__.py", line 1565, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/matplotlib/cbook/deprecation.py", line 358, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/matplotlib/cbook/deprecation.py", line 358, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/matplotlib/axes/_axes.py", line 5626, in imshow
    im.set_data(X)
  File "/usr/local/lib/python3.7/dist-packages/matplotlib/image.py", line 699, in set_data
    .format(self._A.shape))
TypeError: Invalid shape (64, 64, 1) for image data

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions