Skip to content

Fix AttributeError in ColormapRegistry#223

Open
Aditya-Bajra wants to merge 1 commit intoDepthAnything:mainfrom
Aditya-Bajra:fix/colormap-error
Open

Fix AttributeError in ColormapRegistry#223
Aditya-Bajra wants to merge 1 commit intoDepthAnything:mainfrom
Aditya-Bajra:fix/colormap-error

Conversation

@Aditya-Bajra
Copy link

Problem:

In the original code of run.py, the line:
cmap = matplotlib.colormaps.get_cmap('Spectral_r')

was causing the following error:
AttributeError: 'ColormapRegistry' object has no attribute 'get_cmap'

This error occurs because in newer versions of matplotlib, the method for retrieving colormaps has changed.

Solution:

Replaced matplotlib.colormaps.get_cmap('Spectral_r') with plt.get_cmap('Spectral_r'), which is the correct method to access colormaps in matplotlib.

Impact:

This change ensures compatibility with newer versions of matplotlib and resolves the AttributeError

Fix AttributeError in ColormapRegistry: add get_cmap method
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.

1 participant

Comments