-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
paddlepaddle保存的静态模型通过paddle.jit.load载入成 translated_layer,关于translated_layer的使用问题 #50003
Comments
您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档、常见问题、历史Issue、AI社区来寻求解答。祝您生活愉快~ Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the API,FAQ,Github Issue and AI community to get the answer.Have a nice day! |
#47908 这个内部api好像说能用,但追去源码并没有这个函数 |
您好, Question2: 这个IntermediateLayerGetter 接口目前并没有在正式版本中发布,如果需要使用只能暂时通过安装develop版本使用,先参考这个脚本中的用法即可。https://github.com/PaddlePaddle/Paddle/blob/39adb22aba6520ac2147ea320411dc94fec55f57/python/paddle/fluid/tests/unittests/test_IntermediateLayerGetter.py |
Thanks for your reply. 其中paddle.jit.load("inference_model/yolov3_darknet53_270e_coco/model")的模型是通过以下代码输出的: "python E:/PYTHON/PaddleDetection-release-2.5/tools/export_model.py Question2: 那正式版中是否有其他api可以实现eval时,是否可以取中间层的结果出来? |
Question1:建议参考下PaddleDetection的这个介绍,看是否能运行成功?https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.5/deploy/python Question2:目前暂时还没有正式版的API,需要要等后续发版计划。 |
请提出你的问题 Please ask your question
载入静态模型到 translated_layer后无法使用。代码如下:
import paddle
translated_layer = paddle.jit.load("inference_model/yolov3_darknet53_270e_coco/model")##已经载入成功
program = translated_layer.program()
print((program))
translated_layer.eval()
x = paddle.zeros([1,3, 416,416], 'float32')
pred = translated_layer(x)
print(pred)
————————————————————————
Error Msg:
Traceback (most recent call last):
File "E:/PYTHON/trainPaddleDetection/01/inferOutput.py", line 13, in
pred = translated_layer(x)
File "D:\ProgramData\Anaconda3\envs\paddle21\lib\site-packages\paddle\fluid\dygraph\layers.py", line 930, in call
return self._dygraph_call_func(*inputs, **kwargs)
File "D:\ProgramData\Anaconda3\envs\paddle21\lib\site-packages\paddle\fluid\dygraph\layers.py", line 915, in _dygraph_call_func
outputs = self.forward(*inputs, **kwargs)
File "D:\ProgramData\Anaconda3\envs\paddle21\lib\site-packages\paddle\fluid\dygraph\io.py", line 1329, in i_m_p_l
return _run_dygraph(self, input, program_holder)
File "D:\ProgramData\Anaconda3\envs\paddle21\lib\site-packages\paddle\fluid\dygraph\io.py", line 877, in _run_dygraph
_valid_vars(double_grad_vars), *attrs)
ValueError: (InvalidArgument) The conv2d Op's Input Variable
Input
contains uninitialized Tensor.[Hint: Expected t->IsInitialized() == true, but received t->IsInitialized():0 != true:1.] (at ..\paddle\fluid\framework\operator.cc:2094)
[operator < conv2d > error] [operator < run_program > error]
Question1:
Input
contains uninitialized Tensor,但如何初始化没找到头绪,文档也是类似我这个的使用:https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/jit/TranslatedLayer_cn.html 好像也没有哪里有初始化。Question2: translated_layer 文档说是layer的继承类,那eval时,是否可以取中间层的结果出来,要如何操作?
thank you
The text was updated successfully, but these errors were encountered: