Skip to content

AttributeError: 'FigureCanvasAgg' object has no attribute 'tostring_rgb'  #2411

@Mehmet2407

Description

@Mehmet2407

Whenever I press "train model" it goes up to 5.3 seconds and then says error on the progress bar. The command window shows this error in the last line. I have no idea what's wrong

Activity

kunibald413

kunibald413 commented on Dec 15, 2024

@kunibald413

same here

Sol-III-Observer

Sol-III-Observer commented on Dec 15, 2024

@Sol-III-Observer

+1

kunibald413

kunibald413 commented on Dec 15, 2024

@kunibald413

i think this might be only related to tensorboard logs
if you don't need them you can just comment out the code or skip it

in infer/lib/train/utils.py find the summarize function and try catch it

def summarize(
    writer,
    global_step,
    scalars={},
    histograms={},
    images={},
    audios={},
    audio_sampling_rate=22050,
):
    try:
        for k, v in scalars.items():
            writer.add_scalar(k, v, global_step)
        for k, v in histograms.items():
            writer.add_histogram(k, v, global_step)
        for k, v in images.items():
            writer.add_image(k, v, global_step, dataformats="HWC")
        for k, v in audios.items():
            writer.add_audio(k, v, global_step, audio_sampling_rate)
    except Exception as e:
        print(f"Exception when summarizing  {e}. Skip, we don't care!")
5uperninj4

5uperninj4 commented on Dec 18, 2024

@5uperninj4

+1. Looking for solution

xpdd123

xpdd123 commented on Dec 20, 2024

@xpdd123

pip install matplotlib==3.7.0,
It work for me

TheTrustedComputer

TheTrustedComputer commented on Dec 30, 2024

@TheTrustedComputer

I also faced this error in the terminal window once training started. The workaround is downgrading matplotlib to 3.9 with: pip install matplotlib<3.10, likely due to breaking API changes with 3.10.

anurag12-webster

anurag12-webster commented on Jan 1, 2025

@anurag12-webster

same, downgrading to pip install matplotlib==3.7.0 worked for me,

Charles-yueyue831

Charles-yueyue831 commented on Jan 5, 2025

@Charles-yueyue831

pip install matplotlib==3.7.0, It work for me

I agree with you

cahayamahardika16

cahayamahardika16 commented on Jan 9, 2025

@cahayamahardika16

But you got this error thing was matplotlib this expired.
Capture 253

meisei4

meisei4 commented on Jan 10, 2025

@meisei4

I think this might be related? (matplotlib/matplotlib#25484), I am not using this repos software, but i am using matplotlib version 3.10 and getting this error from trying to show plots in the jetbrains IDE PyCharm 2024.1.3 (Professional Edition, Runtime version: 17.0.11+1-b1207.24 x86_64, macOS 12.7.6) viewer:

trace:

...
lib/python3.12/site-packages/matplotlib/pyplot.py", line 614, in show
    return _get_backend_mod().show(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm_matplotlib_backend/backend_interagg.py", line 41, in __call__
    manager.show(**kwargs)
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm_matplotlib_backend/backend_interagg.py", line 144, in show
    self.canvas.show()
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm_matplotlib_backend/backend_interagg.py", line 85, in show
    buffer = self.tostring_rgb()
             ^^^^^^^^^^^^^^^^^
AttributeError: 'FigureCanvasInterAgg' object has no attribute 'tostring_rgb'. Did you mean: 'tostring_argb'?

Process finished with exit code 1
...

Workaround is using matplotlib version 3.9.4 and below i think... (at least i tested with 3.9.4 and that solved my issue

cahayamahardika16

cahayamahardika16 commented on Jan 11, 2025

@cahayamahardika16

I got failure Preprocessing and Feature Extraction "AttributeError: 'NoneType' object has no attribute 'loader'"

boycececil666gmailcom

boycececil666gmailcom commented on Jan 22, 2025

@boycececil666gmailcom

I am pretty sure the update of the matplotlib break its support with seaborn

ikamensh

ikamensh commented on Jan 22, 2025

@ikamensh

someone should report this to matplotlib. I got this error while plotting generic data.

9 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @Docteur-RS@TheTrustedComputer@ikamensh@meisei4@xpdd123

      Issue actions

        AttributeError: 'FigureCanvasAgg' object has no attribute 'tostring_rgb' · Issue #2411 · RVC-Project/Retrieval-based-Voice-Conversion-WebUI