AttributeError: 'FigureCanvasAgg' object has no attribute 'tostring_rgb'
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
same here
+1
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!")
+1. Looking for solution
pip install matplotlib==3.7.0, It work for me
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.
same, downgrading to pip install matplotlib==3.7.0 worked for me,
pip install matplotlib==3.7.0, It work for me
I agree with you
But you got this error thing was matplotlib this expired.
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
I got failure Preprocessing and Feature Extraction "AttributeError: 'NoneType' object has no attribute 'loader'"
I am pretty sure the update of the matplotlib break its support with seaborn
someone should report this to matplotlib. I got this error while plotting generic data.
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
Having the exact same issue. Downgrading matplotlib didn't help, no matter which version I tried.
same as alobito. I downgraded matplotlib with pip install matplotlib==3.7.0 as explained above.... but it solved nothing :/ Got same error message.
it was removed on matplotlib 3.10. If you want to use downgrade to <3.10
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
As of today (03/04/25) doing pip install matplotlib==3.7.0 fixed the error and got to the epoch part.
Python in3.12.0,downgrading to pip install matplotlib==3.9.0works though in 3.7.0 seems still dysfunctional