举例:在I2VGen-XL的推理环境安装中,如果安装了2.24.0以后版本的 open_clip_torch ,那么这些版本中的Transformer具有默认的 batch_first=True 参数,特别是在函数调用中很难找到如何在传递中增加这个变更后的参数。

这可能导致出现如下报错:

Exception: Failed to invoke function <function inference_i2vgen_entrance at 0x7f5e6f958c10>, with The shape of the 2D attn_mask is torch.Size([77, 77]), but should be (1, 1).

解决方案其实可以直接参考open_clip_torch的变更方法,即:
commit

对于VGen来说,就是注释图中的两行对x的变换。源代码位于Github/VGen/tools/modules/clip_embedder.py
修订方法

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐