Skip to content

wgan_loss使用gp的时候报错 #3060

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

Open
HLinShan opened this issue Aug 8, 2019 · 8 comments
Open

wgan_loss使用gp的时候报错 #3060

HLinShan opened this issue Aug 8, 2019 · 8 comments
Assignees

Comments

@HLinShan
Copy link

HLinShan commented Aug 8, 2019

https://github.com/PaddlePaddle/models/blob/v1.5.1/PaddleCV/PaddleGAN/trainer/StarGAN.py 根据stargan 的训练模式train,加入gp_loss 可是一直报错,d_loss+=gp_loss 时候 报错 grad_op_maker_ should not be null ,好像是 gp_loss 梯度截断有问题

@ceci3
Copy link
Contributor

ceci3 commented Aug 8, 2019

您好,麻烦贴下paddle的版本,您机器的环境和具体报错信息~

@HLinShan
Copy link
Author

HLinShan commented Aug 8, 2019

您好,paddle版本1.5 cuda 8.0 cudnn_v7
我想要我生成的图片和原生的图片 做一个wgan loss 参考 上面那个链接starGan 做一个 gp_loss
图片
我在gradient_penalty函数里面 改了一些东西,比如我的判别器是 x,style 两张图片cat 传入。

@HLinShan
Copy link
Author

HLinShan commented Aug 8, 2019

错误信息:
图片

@HLinShan
Copy link
Author

HLinShan commented Aug 8, 2019

图片
如果把这个 db_loss 这个gp_loss 注释 ,就会卡住不执行也不报错

@HLinShan
Copy link
Author

HLinShan commented Aug 8, 2019

图片
计算loss

@ceci3
Copy link
Contributor

ceci3 commented Aug 9, 2019

报错原因是 double backward的操作并不是所有op都支持,用户在stargan的基础上修改了判别器网络,判别网络中使用了不支持double backward的op,如batch norm,reshape等op,所以会报错GradOp没有注册。

@luotao1
Copy link
Contributor

luotao1 commented Aug 9, 2019

grad_op_maker_ should not be null 错误信息提示在PaddlePaddle/Paddle#19070 进行优化。

@Xreki
Copy link
Contributor

Xreki commented Aug 15, 2019

PaddlePaddle/Paddle#19070 已经merge。但PaddlePaddle/Paddle#19070 是通过proto拿到op的type,然后在报错信息中予以提示。double grad这种情况,其proto为null,因为报错里面也无法提供真正的type信息。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants