-
Notifications
You must be signed in to change notification settings - Fork 764
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
Create 【Hackathon No.111】 PR.md #4708
Conversation
任务111PR提交 AI Studio 任务链接:https://aistudio.baidu.com/aistudio/projectdetail/3910079
Thanks for your contribution! |
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.
Great work! LGTM
paddle.jit.save(net, path='./simple_net', input_spec=[InputSpec(shape=[None, 10], name='x'), True]) | ||
|
||
``` | ||
它他并没有报错,但是paddle.jit.save时在input_spec时我指定了非tensor的数据,而且程序运行并没有报错,这会不会与原因有点冲突?文档原因截图如下: |
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.
非常感谢如此细心的发现,这个是属于文档更新时遗漏了。input_spec现在支持了指定非Tensor参数来覆盖forward函数默认的值。我们会更新下此部分文档的。
|
||
支持语法相对来说是比较全面的,介绍的也比较细致。控制流语法等用起来也比较流畅。但是在第三方相关库numpy中只是简单的说了部分支持,并没有具体的例子解释numpy操作中哪部分是支持的,哪部分是不支持的。并且在案例解析--三、内嵌Numpy操作中直接写到动态图模型代码中numpy相关的操作不能转换为静态图,虽然提供了一个好的方法来解决这个问题(转换为tensor),虽然能理解下来但是感觉这两部分写的不具体且有点矛盾。 | ||
![4df67d8440d0fc20490cbd09cbd5498](https://user-images.githubusercontent.com/102226413/165878773-640e73c2-d343-4fb2-8d6b-af3947d9c6bb.png) | ||
![5c43735dfac00b3290cf2b0b5c58b3d](https://user-images.githubusercontent.com/102226413/165878786-ed404b8c-ab03-43a7-9b15-9dc56dc44635.png) |
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.
感谢您对此文档问题反馈。这部分确实缺少了一些详细的解释说明。如果用户在forward里存在将一个Tensor转为numpy进行计算,最后又转回Tensor继续运算,这种场景下是不支持的。因为飞桨无法感知到numpy API,目前仅能感知到Paddle API。我们在这里有说明:https://www.paddlepaddle.org.cn/documentation/docs/zh/guides/04_dygraph_to_static/case_analysis_cn.html#numpy
后续我们会关联下各个文档。
|
||
``` | ||
报错日志如下图,在paddle内置的方法中有点难以快速定位到问题所在。该报错问题应该是第7行paddle.reshape的维度设置不对。但是在使用排错日志的时候,没有报错信息直接定位到第7行。个人觉得对错误代码位置的直接定位才是最重要的。而且报错的内容提示太多,对新手来说不会很友好。建议直接在报错的时候,报错的最后位置,重复一遍,最重要的报错信息,并提示报错代码所在位置。这样对新手比较友好。对于这种简单问题的报错提示更加明确一点会让使用者觉得更加方便。 | ||
![@6U(A`{~$P$`XD1I{YGYOLT](https://user-images.githubusercontent.com/102226413/165878813-ec7a90b6-518b-4a2c-ae68-8a92572ff96a.png) |
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.
- 文档层面 | ||
|
||
文档整体比较完善,但是在使用指南->动态图转静态图->案例解析 中全部都是动静转化机制的各种API的分章节介绍,建议在案例解析最后增加一个完整的实例代码,比如cifar10图像分类的动态图转静态图案例,或者把应用实践中的案例链接附在最后,方便读者找寻。有些读者可能想找一个案例,然后找了使用指南的案例解析,发现没有一个完整的案例,正巧这个读者对整个文档不熟悉,没看过应用实践,然后就找不到案例。 | ||
|
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.
感谢您的建议,最佳实践的样例我们后续会不断的补充和上线,也非常欢迎在AIStudio贡献更多动转静模型样例
@@ -0,0 +1,119 @@ | |||
- 一个完整的使用动静转换@to_static导出、可部署的模型完整代码(参考以图搜图),提供 AI Studio 任务链接 | |||
AI Studio 任务链接:https://aistudio.baidu.com/aistudio/projectdetail/3910079 |
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.
这里是参考的我们官网的【以图搜图】来体验的,可否使用其他的的模型来试用下?
可以任意选择3个动态图模型,领域不限(最好不是Paddle模型套件中的),提供完整动转静 AI studio 链接:
- 支持动转静训练
- 支持模型导出
- 动态图eval预测和
paddle.jit.load
动转静加载预测结果一致
您的样例将有机会被采纳为飞桨官网的【最佳实践】样例供更多开发者学习和参考。
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.
您好,我们写了三个动态图转静态图的案例:
【图像去噪】
https://aistudio.baidu.com/aistudio/projectdetail/3940662
【语义分割】
https://aistudio.baidu.com/aistudio/projectdetail/3917711
【人脸识别】
https://aistudio.baidu.com/aistudio/projectdetail/3935077
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.
【语义分割】
非常赞!
有个小问题,语义分割的代码是没有上传么?我点击上面链接进去似乎是不完整的?
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.
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.
LGTM~~
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.
LGTM~~
可以将这三个AI Studio的案例,按官网应用实践的内容格式,提PR至 https://github.com/PaddlePaddle/docs/tree/develop/docs/practices/jit
这个目录下么 谢谢!~
#4753 |
任务111PR提交
AI Studio 任务链接:https://aistudio.baidu.com/aistudio/projectdetail/3910079