Skip to content
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

如何实现求三阶导数 #696

Closed
gerjf22 opened this issue Dec 13, 2023 · 3 comments
Closed

如何实现求三阶导数 #696

gerjf22 opened this issue Dec 13, 2023 · 3 comments

Comments

@gerjf22
Copy link

gerjf22 commented Dec 13, 2023

请提出你的问题 Please ask your question

我在计算三阶导数时出了一些问题。

当我需要求 d^3u/dxdy^2 时(即u先对y求二阶导,再对x求一阶导),我先计算 du_yy = hessian(u, y),再计算 du_yyx = jacobian(du_yy, x)。

报错为:RuntimeError: (Unavailable) The Op add_triple_grad doesn't have any gradop. If you don't intend calculating higher orderderivatives, please set create_graphto False.

请问该怎样实现呢?

@HydrogenSulfate
Copy link
Collaborator

HydrogenSulfate commented Dec 13, 2023

请提出你的问题 Please ask your question

我在计算三阶导数时出了一些问题。

当我需要求 d^3u/dxdy^2 时(即u先对y求二阶导,再对x求一阶导),我先计算 du_yy = hessian(u, y),再计算 du_yyx = jacobian(du_yy, x)。

报错为:RuntimeError: (Unavailable) The Op add_triple_grad doesn't have any gradop. If you don't intend calculating higher orderderivatives, please set create_graphto False.

请问该怎样实现呢?

如果方便的话,是否可以提供一下能触发这个报错的最小可复现代码以及paddle的版本信息呢

终端执行:python -c "import paddle; paddle.version.show()" 可以打印出paddle版本信息

之前遇到过这个问题,可能是paddle比较老导致的,可以在官网:https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/develop/install/pip/linux-pip.html上安装最新的develop版paddle再运行试试看?

@gerjf22
Copy link
Author

gerjf22 commented Dec 13, 2023

请提出你的问题 Please ask your question

我在计算三阶导数时出了一些问题。
当我需要求 d^3u/dxdy^2 时(即u先对y求二阶导,再对x求一阶导),我先计算 du_yy = hessian(u, y),再计算 du_yyx = jacobian(du_yy, x)。
报错为:RuntimeError: (Unavailable) The Op add_triple_grad doesn't have any gradop. If you don't intend calculating higher orderderivatives, please set create_graphto False.
请问该怎样实现呢?

如果方便的话,是否可以提供一下能触发这个报错的最小可复现代码以及paddle的版本信息呢

终端执行:python -c "import paddle; paddle.version.show()" 可以打印出paddle版本信息

之前遇到过这个问题,可能是paddle比较老导致的,可以在官网:https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/develop/install/pip/linux-pip.html上安装最新的develop版paddle再运行试试看?

我下载了最新的develop版paddle,可以解决问题。感谢你!

@gerjf22 gerjf22 closed this as completed Dec 13, 2023
@HydrogenSulfate
Copy link
Collaborator

请提出你的问题 Please ask your question

我在计算三阶导数时出了一些问题。
当我需要求 d^3u/dxdy^2 时(即u先对y求二阶导,再对x求一阶导),我先计算 du_yy = hessian(u, y),再计算 du_yyx = jacobian(du_yy, x)。
报错为:RuntimeError: (Unavailable) The Op add_triple_grad doesn't have any gradop. If you don't intend calculating higher orderderivatives, please set create_graphto False.
请问该怎样实现呢?

如果方便的话,是否可以提供一下能触发这个报错的最小可复现代码以及paddle的版本信息呢
终端执行:python -c "import paddle; paddle.version.show()" 可以打印出paddle版本信息
之前遇到过这个问题,可能是paddle比较老导致的,可以在官网:https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/develop/install/pip/linux-pip.html上安装最新的develop版paddle再运行试试看?

我下载了最新的develop版paddle,可以解决问题。感谢你!

好的,感谢对 PaddleScience 的关注。由于框架迭代速度比较快,之前一直依赖于 develop paddle,近期 2.6 发版之后会切换到该版本上,避免用户使用老版的 develop 遇到问题。

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

No branches or pull requests

2 participants