mulanai / MuLan

MuLan: Adapting Multilingual Diffusion Models for 110+ Languages (无需额外训练为任意扩散模型支持多语言能力)
125 stars 3 forks source link

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument mat1 in method wrapper_CUDA_addmm) #6

Open xiaowu-1998 opened 1 month ago

xiaowu-1998 commented 1 month ago

File "/usr/local/lib/python3.10/dist-packages/mulankit/api.py", line 58, in func def func(*args, kwargs): return encode_prompt_sdxl(pipe, *args, *kwargs) File "/usr/local/lib/python3.10/dist-packages/mulankit/patch.py", line 468, in encode_prompt_sdxl prompt_embeds, pooled_prompt_embeds = self.unet.adapter(prompt_embeds, pooled_prompt_embeds) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(args, kwargs) File "/usr/local/lib/python3.10/dist-packages/mulankit/models/adapter.py", line 111, in forward encoder_hidden_states1 = self.adapter1(encoder_hidden_states) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, kwargs) File "/usr/local/lib/python3.10/dist-packages/mulankit/models/adapter.py", line 82, in forward encoder_hidden_states = self.proj(encoder_hidden_states) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, *kwargs) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/container.py", line 217, in forward input = module(input) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(args, kwargs) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/linear.py", line 114, in forward return F.linear(input, self.weight, self.bias) RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument mat1 in method wrapper_CUDA_addmm)

what can I do for solving this problem?