ROCm / rocprofiler-compute

Advanced Profiling and Analytics for AMD Hardware
https://rocm.docs.amd.com/projects/omniperf/en/latest/
MIT License
135 stars 49 forks source link

ImportError: cannot import name 'rcParams' from 'matplotlib.axes' #96

Closed Luke20000429 closed 1 year ago

Luke20000429 commented 1 year ago

The code below causes an ImportError, but I didn't see axis used anywhere. https://github.com/AMDResearch/omniperf/blob/0705db024c184bb8b99e64eea36b1cf36c062e0a/src/omniperf_analyze/utils/parser.py#L30

Traceback (most recent call last):
  File "/opt/omniperf/1.0.7/bin/omniperf", line 42, in <module>
    from omniperf_analyze.omniperf_analyze import roofline_only  # Standalone roofline
  File "/opt/omniperf/1.0.7/bin/omniperf_analyze/omniperf_analyze.py", line 45, in <module>
    from omniperf_analyze.utils import parser, file_io
  File "/opt/omniperf/1.0.7/bin/omniperf_analyze/utils/parser.py", line 37, in <module>
    from matplotlib import pyplot as plt
  File "/opt/omniperf/python-libs/matplotlib/pyplot.py", line 61, in <module>
    from matplotlib.figure import Figure, FigureBase, figaspect
  File "/opt/omniperf/python-libs/matplotlib/figure.py", line 29, in <module>
    from matplotlib import _blocking_input, backend_bases, _docstring, projections
  File "/opt/omniperf/python-libs/matplotlib/projections/__init__.py", line 58, in <module>
    from mpl_toolkits.mplot3d import Axes3D
  File "/usr/lib/python3/dist-packages/mpl_toolkits/mplot3d/__init__.py", line 1, in <module>
    from .axes3d import Axes3D
  File "/usr/lib/python3/dist-packages/mpl_toolkits/mplot3d/axes3d.py", line 27, in <module>
    from matplotlib.axes import Axes, rcParams
ImportError: cannot import name 'rcParams' from 'matplotlib.axes' (/opt/omniperf/python-libs/matplotlib/axes/__init__.py)

I am running on a ubuntu20.04 server via ssh and I've enabled X11 forward. The requirements.txt doesn't specify the version of matplotlib and on my server it is 3.7.0.

It looks OK if I just comment this line.

coleramos425 commented 1 year ago

Thanks for bringing this to our attention @Luke20000429. I cannot seem to replicate this issue on my system (Ubuntu 20.04, matplotlib 3.6.1).

Nonetheless, you are correct that we no longer use that module in this code. I've removed its reference and added the change to our next milestone.

If you face any other matplotlib issues please let us know. Thanks.