Kwai-Kolors / Kolors

Kolors Team
Apache License 2.0
3.86k stars 268 forks source link

Error when execute demo example! #42

Closed CN-COTER closed 3 months ago

CN-COTER commented 4 months ago

When execute: python3 scripts/sample.py "一张瓢虫的照片,微距,变焦,高质量,电影,拿着一个牌子,写着“可图”"

Traceback (most recent call last): File "scripts/sample.py", line 42, in fire.Fire(infer) File "/root/miniconda3/envs/kolors/lib/python3.8/site-packages/fire/core.py", line 143, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "/root/miniconda3/envs/kolors/lib/python3.8/site-packages/fire/core.py", line 477, in _Fire component, remaining_args = _CallAndUpdateTrace( File "/root/miniconda3/envs/kolors/lib/python3.8/site-packages/fire/core.py", line 693, in _CallAndUpdateTrace component = fn(*varargs, kwargs) File "scripts/sample.py", line 29, in infer image = pipe( File "/root/miniconda3/envs/kolors/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context return func(*args, *kwargs) File "/root/miniconda3/envs/kolors/lib/python3.8/site-packages/kolors-0.1-py3.8.egg/kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256.py", line 714, in call ) = self.encode_prompt( File "/root/miniconda3/envs/kolors/lib/python3.8/site-packages/kolors-0.1-py3.8.egg/kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256.py", line 328, in encode_prompt output = text_encoder( File "/root/miniconda3/envs/kolors/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(input, kwargs) File "/root/miniconda3/envs/kolors/lib/python3.8/site-packages/accelerate/hooks.py", line 166, in new_forward output = module._old_forward(*args, kwargs) File "/root/miniconda3/envs/kolors/lib/python3.8/site-packages/kolors-0.1-py3.8.egg/kolors/models/modeling_chatglm.py", line 835, in forward hidden_states, presents, all_hidden_states, all_self_attentions = self.encoder( File "/root/miniconda3/envs/kolors/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, *kwargs) File "/root/miniconda3/envs/kolors/lib/python3.8/site-packages/kolors-0.1-py3.8.egg/kolors/models/modeling_chatglm.py", line 645, in forward layer_ret = layer( File "/root/miniconda3/envs/kolors/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(input, kwargs) File "/root/miniconda3/envs/kolors/lib/python3.8/site-packages/kolors-0.1-py3.8.egg/kolors/models/modeling_chatglm.py", line 549, in forward attention_output, kv_cache = self.self_attention( File "/root/miniconda3/envs/kolors/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, *kwargs) File "/root/miniconda3/envs/kolors/lib/python3.8/site-packages/kolors-0.1-py3.8.egg/kolors/models/modeling_chatglm.py", line 446, in forward context_layer = self.core_attention(query_layer, key_layer, value_layer, attention_mask) File "/root/miniconda3/envs/kolors/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(input, *kwargs) File "/root/miniconda3/envs/kolors/lib/python3.8/site-packages/kolors-0.1-py3.8.egg/kolors/models/modeling_chatglm.py", line 259, in forward matmul_result = torch.baddbmm( RuntimeError: CUDA error: CUBLAS_STATUS_INVALID_VALUE when calling `cublasGemmStridedBatchedExFix( handle, opa, opb, m, n, k, (void)(&falpha), a, CUDA_R_16F, lda, stridea, b, CUDA_R_16F, ldb, strideb, (void*)(&fbeta), c, CUDA_R_16F, ldc, stridec, num_batches, CUDA_R_32F, CUBLAS_GEMM_DEFAULT_TENSOR_OP)`

1030zero commented 4 months ago

image 你好请问这个错误您遇到了么?

CN-COTER commented 3 months ago

image 你好请问这个错误您遇到了么?

严格按照这个流程走,我这边现在没有遇到任何问题。

apt-get install git-lfs

git clone https://github.com/Kwai-Kolors/Kolors

cd Kolors

conda create --name kolors python=3.8

conda activate kolors

pip install -r requirements.txt

python3 setup.py install