Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

module 'matplotlib.cm' has no attribute 'get_cmap' [duplicate]

I'm currently using matplotlib 3.9.0.

I was able to run it before, so I suspect there might be an issue with my environment. I'm not sure how to resolve it.

Here are the details of the error:

File "C:\Users\Desktop\PyTorch_OpenPose_ori\pytorch_advanced-master\4_pose_estimation\inference.py", line 11, in <module>
    from utils.openpose_net import OpenPoseNet
File "C:\Users\Desktop\PyTorch_OpenPose_ori\pytorch_advanced-master\4_pose_estimation\utils\__init__.py", line 4, in <module>
    from .decode_pose import *
File "C:\Users\Desktop\PyTorch_OpenPose_ori\pytorch_advanced-master\4_pose_estimation\utils\decode_pose.py", line 18, in <module>
    cmap = matplotlib.cm.get_cmap('hsv')
AttributeError: module 'matplotlib.cm' has no attribute 'get_cmap'

Could anyone help me figure out how to solve this issue?

I was trying to load weights and perform inference with OpenPose.

like image 392
辻元美桜 Avatar asked Jun 28 '26 08:06

辻元美桜


1 Answers

This error originated from matplotlib version 3.9.0. Try to install older version which might solve your issue:

pip install matplotlib==3.7.3
like image 154
Ja X Avatar answered Jun 29 '26 21:06

Ja X



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!