Skip to content

Update requirements.txt #2068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

Lion-Wu
Copy link
Contributor

@Lion-Wu Lion-Wu commented Feb 17, 2025

fix #1991

Matplotlib should be below version 3.10 to avoid AttributeError.

我可以复现,Matplotlib 最新版本是 3.10,其中移除了 tostring_rgb,导致在训练 v2 SoVITS 模型的时候出现 AttributeError: 'FigureCanvasAgg' object has no attribute 'tostring_rgb'. Did you mean: 'tostring_argb'?

降至 3.10 以下版本解决。

Matplotlib should be below version 3.10 to avoid AttributeError.
@KamioRinn
Copy link
Contributor

涉及的包好像还挺多。直接把

    data = np.fromstring(fig.canvas.tostring_rgb(), dtype=np.uint8, sep="")
    data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))

换成

    data = np.asarray(fig.canvas.renderer.buffer_rgba(), dtype=np.uint8)[:,:,:3]

怎么样

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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