x2paddle.convert.onnx2paddle没有生成任何东西

omhiaaxx  于 3个月前  发布在  其他
关注(0)|答案(6)|浏览(73)

bug描述 Describe the Bug

import torch
import x2paddle.convert as convert
convert.onnx2paddle("yolox_nano.onnx", './pdmodel', convert_to_lite=False, lite_valid_places="arm", lite_model_type="naive_buffer")
环境位anaconda环境启动的python3.10。已经安装完paddlepaddle的cpu版本,已经安装x2paddle。但是执行这个api的时候不报错,但也不产生任何东西

其他补充信息 Additional Supplementary Information

No response

wpcxdonn

wpcxdonn1#

目前才适配到 2.4.2 版本。

vhipe2zx

vhipe2zx2#

目前才适配到 2.4.2 版本。

我需要做什么,我现在有onnx,我需要onnx转换成paddle的模型,在百度昆仑芯的r100上运行。我需要降低paddle版本?python的版本是什么?

kuuvgm7e

kuuvgm7e3#

PaddlePaddle/X2Paddle#1053
这个issue可以作为参考,先用低版本的paddle转换onnx模型,再试试2.6.1版本的paddle能否加载运行

qyuhtwio

qyuhtwio4#

我现在在服务器上使用官方文档 https://www.paddlepaddle.org.cn/inference/v2.6/guides/export_model/outside_model_export.html

git clone https://github.com/PaddlePaddle/X2Paddle.git
cd X2Paddle
python setup.py install

安装完成后,用 x2paddle --framework onnx --model yolox_nano.onnx --save_dir pdmodel
指令
报错信息如下:
Error: Can not import paddle core while this file exists: /root/anaconda3/lib/python3.10/site-packages/paddle/base/libpaddle.so
Traceback (most recent call last):
File "/root/anaconda3/bin/x2paddle", line 33, in
sys.exit(load_entry_point('x2paddle==1.4.1', 'console_scripts', 'x2paddle')())
File "/root/anaconda3/bin/x2paddle", line 25, in importlib_load_entry_point
return next(matches).load()
File "/root/anaconda3/lib/python3.10/importlib/metadata/init.py", line 171, in load
module = import_module(match.group('module'))
File "/root/anaconda3/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 992, in _find_and_load_unlocked
File "", line 241, in _call_with_frames_removed
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/root/anaconda3/lib/python3.10/site-packages/x2paddle/init.py", line 3, in
from .core.program import PaddleGraph
File "/root/anaconda3/lib/python3.10/site-packages/x2paddle/core/program.py", line 18, in
import paddle
File "/root/anaconda3/lib/python3.10/site-packages/paddle/init.py", line 28, in
from .base import core # noqa: F401
File "/root/anaconda3/lib/python3.10/site-packages/paddle/base/init.py", line 36, in
from . import core
File "/root/anaconda3/lib/python3.10/site-packages/paddle/base/core.py", line 380, in
raise e
File "/root/anaconda3/lib/python3.10/site-packages/paddle/base/core.py", line 268, in
from . import libpaddle
ImportError: libgomp.so.1: cannot open shared object file: No such file or directory
请问需要怎么解决。
另外百度现在onnx2paddle的解决方案是什么,目前有没有稳定的版本。需要配置的python版本和paddle版本是什么。

3mpgtkmj

3mpgtkmj5#

可以使用 开发镜像paddlepaddle/x2paddle:latest-dev-cuda11.2-cudnn8-gcc82 默认Python版本是3.7,里面安装的paddle版本是2.4.2 @yuyuyupg

moiiocjp

moiiocjp6#

使用的版本是paddlepaddle==2.6.1,cpu版本。因为硬件适配问题,只能用2.6.1版本
python==3.10

相关问题