PaddlePaddle / PaddleSeg

Easy-to-use image segmentation library with awesome pre-trained model zoo, supporting wide-range of practical tasks in Semantic Segmentation, Interactive Segmentation, Panoptic Segmentation, Image Matting, 3D Segmentation, etc.
https://arxiv.org/abs/2101.06175
Apache License 2.0
8.6k stars 1.68k forks source link

export导出模型出现问题 #3669

Open Daniel-969 opened 6 months ago

Daniel-969 commented 6 months ago

问题确认 Search before asking

请提出你的问题 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 commented 6 months ago

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