PromptAD icon indicating copy to clipboard operation
PromptAD copied to clipboard

Execution error with run_cls.py

Open CaesarDingg opened this issue 1 year ago • 8 comments

I executed the run_cls.py file according to the readme and encountered the following error (my env: win10 with rtx3060): Traceback (most recent call last): File "C:\Users\35314\Desktop\PromptAD\PromptAD\CLIPAD\model.py", line 236, in encode_text_embeddings x = x + self.positional_embedding.to(cast_dtype) RuntimeError: The size of tensor a (105) must match the size of tensor b (77) at non-singleton dimension 1

可能是显卡不支持?

CaesarDingg avatar Jun 11 '24 03:06 CaesarDingg

你是不是修改了backbone 

------------------ Original ------------------ From: CaesarDingg @.> Date: Tue,Jun 11,2024 11:29 AM To: FuNz-0/PromptAD @.> Cc: Subscribed @.***> Subject: Re: [FuNz-0/PromptAD] Execution error with run_cls.py (Issue #9)

I executed the run_cls.py file according to the readme and encountered the following error (my env: win10 with rtx3060): Traceback (most recent call last): File "C:\Users\35314\Desktop\PromptAD\PromptAD\CLIPAD\model.py", line 236, in encode_text_embeddings x = x + self.positional_embedding.to(cast_dtype) RuntimeError: The size of tensor a (105) must match the size of tensor b (77) at non-singleton dimension 1

可能是显卡不支持?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

FuNz-0 avatar Jun 11 '24 03:06 FuNz-0

你是不是修改了backbone  ------------------ Original ------------------ From: CaesarDingg @.> Date: Tue,Jun 11,2024 11:29 AM To: FuNz-0/PromptAD @.> Cc: Subscribed @.> Subject: Re: [FuNz-0/PromptAD] Execution error with run_cls.py (Issue #9) I executed the run_cls.py file according to the readme and encountered the following error (my env: win10 with rtx3060): Traceback (most recent call last): File "C:\Users\35314\Desktop\PromptAD\PromptAD\CLIPAD\model.py", line 236, in encode_text_embeddings x = x + self.positional_embedding.to(cast_dtype) RuntimeError: The size of tensor a (105) must match the size of tensor b (77) at non-singleton dimension 1 可能是显卡不支持? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.>

没改,只尝试跑了visa

CaesarDingg avatar Jun 11 '24 03:06 CaesarDingg

77的尺度应该是正常的你debug跟踪一下x看看是哪里的问题;

@.***

From: CaesarDingg Date: 2024-06-11 11:34 To: FuNz-0/PromptAD CC: FuNz; Comment Subject: Re: [FuNz-0/PromptAD] Execution error with run_cls.py (Issue #9) 你是不是修改了backbone … ------------------ Original ------------------ From: CaesarDingg @.> Date: Tue,Jun 11,2024 11:29 AM To: FuNz-0/PromptAD @.> Cc: Subscribed @.> Subject: Re: [FuNz-0/PromptAD] Execution error with run_cls.py (Issue #9) I executed the run_cls.py file according to the readme and encountered the following error (my env: win10 with rtx3060): Traceback (most recent call last): File "C:\Users\35314\Desktop\PromptAD\PromptAD\CLIPAD\model.py", line 236, in encode_text_embeddings x = x + self.positional_embedding.to(cast_dtype) RuntimeError: The size of tensor a (105) must match the size of tensor b (77) at non-singleton dimension 1 可能是显卡不支持? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.> 没改,只尝试跑了visa — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

FuNz-0 avatar Jun 11 '24 08:06 FuNz-0

Prompt 具体是这个Prompt是105

WangFengJiee avatar Jun 11 '24 11:06 WangFengJiee

Prompt 具体是这个Prompt是105

image 这是我这边debug的结果,你看看你的问题在哪里

FuNz-0 avatar Jun 11 '24 13:06 FuNz-0

Prompt 具体是这个Prompt是105

image 这是我这边debug的结果,你看看你的问题在哪里

image

问题貌似出在这里,源代码默认的是100,应该是1吧

WangFengJiee avatar Jun 11 '24 13:06 WangFengJiee

Prompt 具体是这个Prompt是105

image 这是我这边debug的结果,你看看你的问题在哪里

image

问题貌似出在这里,源代码默认的是100,应该是1吧

跑通了,谢谢!

CaesarDingg avatar Jun 11 '24 15:06 CaesarDingg

这里

And by changing the n_ctx_ab to 1 can you just reproduce the reported results on ViSA?

AlirezaSalehy avatar Aug 08 '24 08:08 AlirezaSalehy