PaddleSeg icon indicating copy to clipboard operation
PaddleSeg copied to clipboard

export导出模型出现问题

Open Daniel-969 opened this issue 1 year ago • 1 comments

问题确认 Search before asking

  • [X] 我已经搜索过问题,但是没有找到解答。I have searched the question and found no related answer.

请提出你的问题 Please ask your question

我使用paddleseg训练自己的模型,在训练的时候没有问题,导出模型时,在该代码部分报错,没有找到解决方法。 norm = paddle.cast(paddle.to_tensor( [[[[out_w,out_h]]]], 'float32'), y.dtype) 报错原因为: File "/home/daniel/anaconda3/envs/paddle_env/lib/python3.8/site-packages/paddle/tensor/creation.py", line 789, in to_tensor return _to_tensor_static(data, dtype, stop_gradient) File "/home/daniel/anaconda3/envs/paddle_env/lib/python3.8/site-packages/paddle/tensor/creation.py", line 674, in _to_tensor_static to_stack_list[idx] = _to_tensor_static( File "/home/daniel/anaconda3/envs/paddle_env/lib/python3.8/site-packages/paddle/tensor/creation.py", line 697, in _to_tensor_static output = assign(data) File "/home/daniel/anaconda3/envs/paddle_env/lib/python3.8/site-packages/paddle/tensor/creation.py", line 2133, in assign raise TypeError(

TypeError: The type of received input == object, it is not supported to convert to tensor, such as [[Var], [Var], [3], [4]] 问题好像是出在to_tensor函数

Daniel-969 avatar Mar 18 '24 04:03 Daniel-969

@shiyutang 好像是转为静态图的时候出现的问题,请问这是bug吗?

Daniel-969 avatar Mar 18 '24 07:03 Daniel-969