复现代码报错,请求解决
745165806 opened this issue · 4 comments
我按照步骤一步一步配置环境,python sample_multi_v0.py --mode=t2i --prompt="an elephant under the sea"之后,报错
Traceback (most recent call last):
File "/media/ma/data/ptm/unidiffuser-main/sample_multi_v0.py", line 404, in
app.run(main)
File "/home/ma/anaconda3/envs/unidiffuser/lib/python3.9/site-packages/absl/app.py", line 308, in run
_run_main(main, args)
File "/home/ma/anaconda3/envs/unidiffuser/lib/python3.9/site-packages/absl/app.py", line 254, in _run_main
sys.exit(main(argv))
File "/media/ma/data/ptm/unidiffuser-main/sample_multi_v0.py", line 400, in main
evaluate(config)
File "/media/ma/data/ptm/unidiffuser-main/sample_multi_v0.py", line 116, in evaluate
empty_context = clip_text_model.encode([''])[0]
File "/media/ma/data/ptm/unidiffuser-main/libs/clip.py", line 38, in encode
return self(text)
File "/home/ma/anaconda3/envs/unidiffuser/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/media/ma/data/ptm/unidiffuser-main/libs/clip.py", line 32, in forward
outputs = self.transformer(input_ids=tokens)
File "/home/ma/anaconda3/envs/unidiffuser/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/home/ma/anaconda3/envs/unidiffuser/lib/python3.9/site-packages/transformers/models/clip/modeling_clip.py", line 733, in forward
return self.text_model(
File "/home/ma/anaconda3/envs/unidiffuser/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/home/ma/anaconda3/envs/unidiffuser/lib/python3.9/site-packages/transformers/models/clip/modeling_clip.py", line 649, in forward
encoder_outputs = self.encoder(
File "/home/ma/anaconda3/envs/unidiffuser/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/home/ma/anaconda3/envs/unidiffuser/lib/python3.9/site-packages/transformers/models/clip/modeling_clip.py", line 578, in forward
layer_outputs = encoder_layer(
File "/home/ma/anaconda3/envs/unidiffuser/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/home/ma/anaconda3/envs/unidiffuser/lib/python3.9/site-packages/transformers/models/clip/modeling_clip.py", line 321, in forward
hidden_states, attn_weights = self.self_attn(
File "/home/ma/anaconda3/envs/unidiffuser/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/home/ma/anaconda3/envs/unidiffuser/lib/python3.9/site-packages/transformers/models/clip/modeling_clip.py", line 220, in forward
attn_weights = torch.bmm(query_states, key_states.transpose(1, 2))
RuntimeError: CUDA error: CUBLAS_STATUS_INVALID_VALUE when calling cublasSgemmStridedBatched( handle, opa, opb, m, n, k, &alpha, a, lda, stridea, b, ldb, strideb, &beta, c, ldc, stridec, num_batches)
free(): invalid pointer
请问是什么原因
我们更新了一下环境配置的指令,你再试试?
配置了clip之后还是有同样的问题,不清楚是什么原因呢
File "/home/ma/anaconda3/envs/unidiffuser/lib/python3.9/site-packages/transformers/models/clip/modeling_clip.py", line 220, in forward
attn_weights = torch.bmm(query_states, key_states.transpose(1, 2))
RuntimeError: CUDA error: CUBLAS_STATUS_INVALID_VALUE when calling cublasSgemmStridedBatched( handle, opa, opb, m, n, k, &alpha, a, lda, stridea, b, ldb, strideb, &beta, c, ldc, stridec, num_batches)
free(): invalid pointer
已放弃 (核心已转储)
根据新的readme可以了 谢谢~!
Great!