-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
textual_attack.py的token_gradient方法在return处出现one_hot.grad为None而报错 #1
Comments
hello, do u solve the problem? |
No,I'm still stuck in here. |
Hi! Have you resolved this issue? I haven't come across this problem myself. It's possible that there might be some gradient blocking codes in your transformers package's clip_modeling.py, such as @torch.no_grad(), which could be affecting the process. |
Have you solved this problem? |
没有,我这边按照readme的步骤配置的环境,使用mma_diffusion_environment.yml安装的依赖,然后也按照readme中的提示修改了transformer源代码添加了属性,但运行的时候报的错就是token_gradient(model, tokenizer, control, target_embeddings)函数中的return one_hot.grad.clone()一行提示AttributeError: 'NoneType' object has no attribute 'clone',输出发现one_hot对象不包含grad属性。
目前为止仍没有解决这一问题,但也没有遇到过hugg报错API失效的问题。
…------------------ 原始邮件 ------------------
发件人: "cure-lab/MMA-Diffusion" ***@***.***>;
发送时间: 2024年5月26日(星期天) 中午11:27
***@***.***>;
***@***.******@***.***>;
主题: Re: [cure-lab/MMA-Diffusion] textual_attack.py的token_gradient方法在return处出现one_hot.grad为None而报错 (Issue #1)
您好 请问您有碰到过hugg报错API失效吗?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
如图所示,经过loss.backward之后one_hot仍为None类型
The text was updated successfully, but these errors were encountered: