-
Notifications
You must be signed in to change notification settings - Fork 825
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
Try to fix the problem that the insightface cannot converge。 #5906
Conversation
dx->shape().elem_cnt() * sizeof(T)); | ||
Memset<DeviceType::kGPU>(ctx->device_ctx(), alpha_diff->mut_dptr<T>(), 0, | ||
alpha_diff->shape().elem_cnt() * sizeof(T)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里为什么需要memset呢? 感觉每一个位置都会被赋值的啊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dx可以不用memset,alpha_diff是需要的,alpha_diff的kernel实现是累加
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,是这里的问题,忘记清0了,梯度累加炸了。我现在本地验证了resnet50,可以正常收敛。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
按后江的回复,可以删掉dx的memset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改。
Speed stats:
|
Try to fix the problem that the insightface cannot converge 。