PaddleX icon indicating copy to clipboard operation
PaddleX copied to clipboard

使用paddlex转出inference模型失败

Open Ghost1989 opened this issue 3 years ago • 5 comments

使用!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'

Ghost1989 avatar Aug 31 '21 03:08 Ghost1989

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

will-jl944 avatar Sep 01 '21 02:09 will-jl944

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

aaaaalun avatar Feb 27 '22 13:02 aaaaalun

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

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

will-jl944 avatar Feb 27 '22 13:02 will-jl944

您好,我使用的是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 avatar Feb 27 '22 14:02 aaaaalun

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

aaaaalun avatar Feb 27 '22 14:02 aaaaalun