You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
发生异常: RuntimeError
CUDA error: invalid argument
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.
File "/root/project/DiffAttack-main/diff_latent_attack.py", line 541, in diffattack
loss.backward()
File "/root/project/DiffAttack-main/main.py", line 72, in run_diffusion_attack
adv_image, clean_acc, adv_acc = diff_latent_attack.diffattack(diffusion_model, label, controller,
File "/root/project/DiffAttack-main/main.py", line 170, in
adv_image, clean_acc, adv_acc = run_diffusion_attack(tmp_image, label[ind:ind + 1],
RuntimeError: CUDA error: invalid argument
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.
---- 回复的原邮件 ----
| 发件人 | ***@***.***> |
| 发送日期 | 2025年6月13日 14:52 |
| 收件人 | ***@***.***> |
| 抄送人 | Hongbing ***@***.***>,
***@***.***> |
| 主题 | Re: [WindVChen/DiffAttack] 代码里面关于对潜在空间的扰动 (Issue #49) |
WindVChen left a comment (WindVChen/DiffAttack#49)
可以尝试下增大transfer loss的权重,看看是否有更明显的变化?
https://github.com/WindVChen/DiffAttack/blob/main/main.py#L46
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
Activity
WindVChen commentedon Jun 5, 2025
哈喽 @niania-whb ,
这一部分是指对扩散模型的隐变量直接做优化哈,可以看这部分的的代码段,隐变量为优化对象.
Scientist888-star commentedon Jun 5, 2025
这个地方是对latent的有文本部分进行优化,然后用损失Ltransfer去逼近注意力点平均分布吗
WindVChen commentedon Jun 5, 2025
哈喽,准确来说是有三个损失函数共同作用哈(见此). 另外,这里是对整个 latent tensor 进行优化的,并不存在“latent 的文本部分”这种说法。在 classifier-free 的去噪过程中,会对 latent 进行复制,分别在带文本条件和空文本条件下进行去噪,最后将二者的结果融合 (见此).
Scientist888-star commentedon Jun 6, 2025
好嘞,感谢您的解答,我已理解,谢谢!
Scientist888-star commentedon Jun 6, 2025
发生异常: RuntimeError
CUDA error: invalid argument
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with
TORCH_USE_CUDA_DSAto enable device-side assertions.File "/root/project/DiffAttack-main/diff_latent_attack.py", line 541, in diffattack
loss.backward()
File "/root/project/DiffAttack-main/main.py", line 72, in run_diffusion_attack
adv_image, clean_acc, adv_acc = diff_latent_attack.diffattack(diffusion_model, label, controller,
File "/root/project/DiffAttack-main/main.py", line 170, in
adv_image, clean_acc, adv_acc = run_diffusion_attack(tmp_image, label[ind:ind + 1],
RuntimeError: CUDA error: invalid argument
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with
TORCH_USE_CUDA_DSAto enable device-side assertions.您好,我运行时出现这个问题,loss不会出现nan或者inf,显存情况如下,cuda都放到gpu:0上,请问这个是啥问题呢
WindVChen commentedon Jun 6, 2025
这个蛮奇怪的,我这儿没有遇到过这个问题,有改动哪一部分代码嘛?是直接按照ReadMe里的步骤来跑的嘛?
Scientist888-star commentedon Jun 7, 2025
目前没有改动代码,我使用了我自己的数据集,总共20各类别,我先使用预训练好的resnet,fc输出已改成20,不知道是啥情况,是不是跟torch版本有关,我从网上没找到解决办法,使用cpu跑就没问题
WindVChen commentedon Jun 12, 2025
哈喽 @niania-whb ,
不好意思回复晚了,上面这个
TORCH_USE_CUDA_DSA问题以及这个热力点的问题我不是很确定. 这两个问题在默认的ImageNet-Compatible数据集上会出现同样的问题吗?还是说目前只有在私有数据集上出现呢?Scientist888-star commentedon Jun 12, 2025
WindVChen commentedon Jun 12, 2025
上面提到的"cross attention 之前 之后"是指什么呢?
热力图是说变化不明显吗?我看上下两行系列上还是有些变化
Scientist888-star commentedon Jun 12, 2025
WindVChen commentedon Jun 13, 2025
可以尝试下增大transfer loss的权重,看看是否有更明显的变化?
https://github.com/WindVChen/DiffAttack/blob/main/main.py#L46
Scientist888-star commentedon Jun 13, 2025
WindVChen commentedon Jun 14, 2025
我之前没有尝试过比较多的修饰词,大部分都是控制在1-3个文本之内.
那可以先尝试下 1) 减少修饰词,比如约束在1-3个词之内;2) 尝试将structure loss的权重降低,因为它对于个人数据集来说,带来的约束可能比较强.
看看这些是否带来改变.
Scientist888-star commentedon Jun 16, 2025
好的谢谢您,我微调一下stable diffusion试试,您说的我修改后有一定提升