PaddlePaddle / PaddleX

PaddlePaddle End-to-End Development Toolkit(飞桨低代码开发工具)
Apache License 2.0
4.59k stars 904 forks source link

使用paddlex转出inference模型失败 #1085

Open Ghost1989 opened 2 years ago

Ghost1989 commented 2 years ago

使用!paddlex --export_inference --model_dir=output/yolov3_darknet53/best_model --save_dir=inference --fixed_input_shape=[608,608],出错, Traceback (most recent call last): File "/opt/conda/envs/python35-paddle120-env/bin/paddlex", line 6, in from paddlex.command import main File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddlex/init.py", line 18, in init_parallel_env() File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddlex/utils/env.py", line 71, in init_parallel_env paddle.distributed.init_parallel_env() AttributeError: module 'paddle.distributed' has no attribute 'init_parallel_env'

will-jl944 commented 2 years ago

paddlepaddle版本是多少?可以更新至2.1.2再试一下。

aaaaalun commented 2 years ago

@will-jl944 大佬 您好 我使用的是paddlepaddle是2.2的版本了,我成功将paddlex gui最新版本生成的模型导出了,但是在deploy部署的时候总是加载模型失败,换回老版本的paddlex gui导出的模型就可以成功运行起来,请问我该怎么排查?

will-jl944 commented 2 years ago

@will-jl944 大佬 您好 我使用的是paddlepaddle是2.2的版本了,我成功将paddlex gui最新版本生成的模型导出了,但是在deploy部署的时候总是加载模型失败,换回老版本的paddlex gui导出的模型就可以成功运行起来,请问我该怎么排查?

报错信息是什么呢?使用的是哪种部署方式?

aaaaalun commented 2 years ago

您好,我使用的是c++部署的, InvalidArgumentError: The 0th element of 'shape' for expand_v2 op must be greater than 0, but the value given is -2. [Hint: Expected expand_shape[i] > 0, but received expand_shape[i]:-2 <= 0:0.] (at D:\wangye19\Paddle\paddle\fluid\operators\expand_v2_op.cc:75)

aaaaalun commented 2 years ago

@will-jl944 生成的文件和2.2导出的模型文件名一样,大小也差不多,模型转换过程也没有提示任何错误,并在我指定位置也生成了新的文件。