Retrieval-based-Voice-Conversion-WebUI icon indicating copy to clipboard operation
Retrieval-based-Voice-Conversion-WebUI copied to clipboard

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

Open Mehmet2407 opened this issue 1 year ago • 20 comments

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

Mehmet2407 avatar Dec 14 '24 15:12 Mehmet2407

same here

kunibald413 avatar Dec 15 '24 14:12 kunibald413

+1

Sol-III-Observer avatar Dec 15 '24 15:12 Sol-III-Observer

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!")

kunibald413 avatar Dec 15 '24 15:12 kunibald413

+1. Looking for solution

5uperninj4 avatar Dec 18 '24 07:12 5uperninj4

pip install matplotlib==3.7.0, It work for me

xpdd123 avatar Dec 20 '24 05:12 xpdd123

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.

TheTrustedComputer avatar Dec 30 '24 22:12 TheTrustedComputer

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

anurag12-webster avatar Jan 01 '25 09:01 anurag12-webster

pip install matplotlib==3.7.0, It work for me

I agree with you

Charles-yueyue831 avatar Jan 05 '25 11:01 Charles-yueyue831

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

cahayamahardika16 avatar Jan 09 '25 07:01 cahayamahardika16

I think this might be related? (https://github.com/matplotlib/matplotlib/pull/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

meisei4 avatar Jan 10 '25 09:01 meisei4

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

cahayamahardika16 avatar Jan 11 '25 01:01 cahayamahardika16

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

boycececil666gmailcom avatar Jan 22 '25 14:01 boycececil666gmailcom

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

ikamensh avatar Jan 22 '25 20:01 ikamensh

I had the same problem and the following helps me: `import matplotlib

matplotlib.use('TkAgg')` You can try to select another backend manually, here is the documentation https://matplotlib.org/stable/users/explain/figure/backends.html

FHeizenberg avatar Jan 23 '25 12:01 FHeizenberg

Having the exact same issue. Downgrading matplotlib didn't help, no matter which version I tried.

alobito avatar Feb 02 '25 11:02 alobito

same as alobito. I downgraded matplotlib with pip install matplotlib==3.7.0 as explained above.... but it solved nothing :/ Got same error message.

Bartabok avatar Feb 27 '25 21:02 Bartabok

it was removed on matplotlib 3.10. If you want to use downgrade to <3.10

GabrielDornelles avatar Mar 10 '25 13:03 GabrielDornelles

can you help me? im not familiar with these kind of stuff .. just wanted to use RVC but get AttributeError: 'FigureCanvasAgg' object has no attribute 'tostring_rgb' . I tried and downgraded numpy and matplotlib .. but the issue persists

Joseph-Sherman avatar Mar 17 '25 02:03 Joseph-Sherman

As of today (03/04/25) doing pip install matplotlib==3.7.0 fixed the error and got to the epoch part.

Docteur-RS avatar Apr 03 '25 21:04 Docteur-RS

Python in3.12.0,downgrading to pip install matplotlib==3.9.0works though in 3.7.0 seems still dysfunctional

EscoffierZhou avatar Apr 13 '25 04:04 EscoffierZhou