0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

StyleBertVits2 でマージモデルを作成しようとしたらエラー - RuntimeError: The size of tensor a (256) must match the size of tensor b (512)

0
Last updated at Posted at 2026-02-20

要約:

StyleBertVits2 でマージモデルを作成しようとしたら、エラーによりマージできなかった。
それぞれのモデルを学習した StyleBertVits2 のバージョンが違うと、Tensorのサイズが異なってしまうことにより、マージモデルを作成できない。

環境

  • OS: Windows 11 Home
  • CPU: Intel Core i7-14700F
  • GPU: NVIDIA GeForce RTX 4060 8GB
  • RAM: 32GB
  • ストレージ: 1TB, 2TB SN850X SSD

何が起こったのか?

StyleBertVits2-V2.0 で作成されたモデルと、 StyleBertVits2-V3.0 で作成されたモデルをマージして、マージモデルを作成しようとした。

マージボタンを押すと、RuntimeError: The size of tensor a (256) must match the size of tensor b (512)というエラーが発生した。
ターミナルを見ると、どうやら Tensor のサイズが異なっているよう。

調べても情報が見つからなかったので、おま環かもしれないと思い、他のモデルをマージしたらエラーが発生しなかった。
どうやら、V2で作成されたモデルを、自分で学習させたモデル(V3)をマージしようとしたのが原因だったようだ。

おそらく、StyleBertVits2はバージョンによって、 Tensor のサイズが異なっているのではないかと思う。

解決

今回ベースモデルとして使用したモデルは、ayousanz/tsukuyomi-chan-style-bert-vits2-modelというモデルだった。
このモデルは、StyleBertVits2-V2.0で作成されたモデルのようだったので、勉強も含めて自分でモデルを学習することにした。

今回作成したモデル。Version3.0対応 Tsukuyomi-chan

あと、マージを色々試していたら奇跡的にいい感じのモデルができたので、そちらも公開してみた。 自家製モデル

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?