Comments (18)
军哥我觉得初期可以先简单分为几步:
- 基于bash脚本在本地端实现Linux x86_64平台的多python版本分发,python版本应该支持现有的PaddlePaddle Python版本(根据QA同学提供的发布版本的文档来实现)
- 利用Github Actions实现Linux x86_64平台的多python版本自动发包机制(这个可能要咨询下QA同学自动发包大概的流程怎么做)
- 利用Github Actions实现剩余平台(Windows x86_64,Mac Intel, Mac Apple, Linux aarch64)的多python版本自动发包机制
- 建立P2O develop版本的自动发包机制
from paddle2onnx.
@Zheng-Bicheng 开发者你好,我这边同步一下Linux/Win/Mac Intel/Mac M1环境下,Paddle2ONNX的发版流程要点,可以作为发包机制建设的参考。Linux/Windows/Mac Intel 覆盖py3.6到py3.10,Mac M1 覆盖py3.8到py3.10。其他的python版本可能需要进行流程排查。pypi账号相关问题可以联系 @jzhang533 。paddle2onnx CI目前已恢复,如若遇到CI问题可随时联系。
Linux python:
- 1、拉取Paddle2ONNX代码库,${branch}参数为发版分支
git clone -b ${branch} https://github.com/PaddlePaddle/Paddle2ONNX.git
- 2、修改VERSION_NUMBER文件中的版本号
cd Paddle2ONNX
vim VERSION_NUMBER
-
3、部署一个发版环境,可以使用docker,只要能够保证编译成功,并且库版本不会造成非兼容问题,即可。
-
4、python版本至少为3.6以上。目前可走通的流程覆盖py3.6~3.10,
-
5、安装相关依赖用于后续流程,可自行调试修改删减。以python3.9举例:
cd ./Paddle2ONNX
cur_path=pwd
# 记录paddle2onnx绝对路径
python3.9 -m pip install --upgrade pip
python3.9 -m pip install auditwheel
python3.9 -m pip install auditwheel-symbols
- 6、先进行protobuf相关编译安装
git clone https://github.com/protocolbuffers/protobuf.git
cd protobuf
git checkout v3.16.0
mkdir build_source && cd build_source
cmake ../cmake -Dprotobuf_BUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${PWD}/install_dir
make -j8
make install
export PATH=${PWD}/install_dir/bin:${PATH}
cd ${cur_path} # 回到paddle2onnx路径
- 7、安装子模块
git submodule init
git submodule update
- 8、编译paddle2onnx。${version}对应VERSION_NUMBER中的版本号
mkdir build && cd build
CMAKE_INSTALL_PREFIX=${PWD}/paddle2onnx-linux-x64-${version}
cmake .. -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DPYTHON_EXECUTABLE=which python3.9
make -j12 && make install
- 9、删除不必要的临时文件。${version}对应VERSION_NUMBER中的版本号
rm -rf paddle2onnx-linux-x64-${version}/include/onnx
mv paddle2onnx-linux-x64-${version}/lib paddle2onnx-linux-x64-${version}/lib_origin
mkdir paddle2onnx-linux-x64-${version}/lib
cp -r paddle2onnx-linux-x64-${version}/lib_origin/libpaddle2onnx.* paddle2onnx-linux-x64-${version}/lib
rm -rf paddle2onnx-linux-x64-${version}/lib_origin
tar -zcvf paddle2onnx-linux-x64-${version}.tgz paddle2onnx-linux-x64-${version}
- 10、回到paddle2onnx路径,产出wheel包。${version}对应VERSION_NUMBER中的版本号
cd ${cur_path}
python setup_dev.py bdist_wheel
auditwheel repair dist/paddle2onnx-${version}-cp39-cp39-linux_x86_64.whl
from paddle2onnx.
Windows Python:
- 1、拉取Paddle2ONNX代码库,%branch%参数为发版分支
git clone -b %branch% https://github.com/PaddlePaddle/Paddle2ONNX.git
- 2、修改VERSION_NUMBER文件中的版本号
rem 假设路径为D:\Paddle2ONNX
cd Paddle2ONNX
找到VERSION_NUMBER并修改
-
3、部署一个发版环境,只要能够保证编译成功,并且库版本不会造成非兼容问题,即可。
-
4、python版本至少为3.6以上。目前可走通的流程覆盖py3.6~3.10,
-
5、安装相关依赖用于后续流程,可自行调试修改删减。以python3.9举例:
rem 设置MSBuild
set PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin;%PATH%
python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install wget
- 6、先进行protobuf相关编译安装,建议使用VS2019
git clone https://github.com/protocolbuffers/protobuf.git
cd protobuf
git checkout v3.16.0
cd cmake
rem (这里%your_file%是用户可自定义的protobuf安装目录)
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=D:%your_file%\installed_protobuf_lib -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_EXAMPLES=OFF .
msbuild protobuf.sln /m /p:Configuration=Release /p:Platform=x64
msbuild INSTALL.vcxproj /p:Configuration=Release /p:Platform=x64
rem 将protobuf加入环境变量
set PATH=D:%your_file%\installed_protobuf_lib\bin;%PATH%
rem 回到Paddle2ONNX
cd D:\Paddle2ONNX
- 7、安装子模块
git init
git submodule init
git submodule update
- 8、编译paddle2onnx。
mkdir build && cd build
rem 注意,这里要检查是否为python3.9
cmake .. -DCMAKE_INSTALL_PREFIX=./paddle2onnx-win-x64-%version%
msbuild paddle2onnx.sln /m /p:Configuration=Release /p:Platform=x64
msbuild paddle2onnx.vcxproj /p:Configuration=Release /p:Platform=x64
msbuild INSTALL.vcxproj /p:Configuration=Release /p:Platform=x64
- 9、删除不必要的临时文件。
rmdir D:\Paddle2ONNX\build\paddle2onnx-win-x64-%version%\include\onnx /s/q
rmdir D:\Paddle2ONNX\build\paddle2onnx-win-x64-%version%\lib\cmake /s/q
del D:\Paddle2ONNX\build\paddle2onnx-win-x64-%version%\lib\onnx* /s /q
- 10、回到paddle2onnx路径,产出wheel包
cd D:\Paddle2ONNX
python.exe setup.py bdist_wheel
from paddle2onnx.
Mac Intel Python:
步骤1~步骤7,流程与Linux python大致相同。后续步骤中,wheel命名有些区别。
- 8、编译paddle2onnx
mkdir build && cd build
CMAKE_INSTALL_PREFIX=${PWD}/paddle2onnx-osx-x86_64-${version}
cmake .. -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DPYTHON_EXECUTABLE=which python3.9
make -j12 && make install
- 9、删除不必要的临时文件。
rm -rf paddle2onnx-osx-x86_64-${version}/include/onnx
mv paddle2onnx-osx-x86_64-${version}/lib paddle2onnx-osx-x86_64-${version}/lib_origin
mkdir paddle2onnx-osx-x86_64-${version}/lib
cp -r paddle2onnx-osx-x86_64-${version}/lib_origin/libpaddle2onnx.* paddle2onnx-osx-x86_64-${version}/lib
rm -rf paddle2onnx-osx-x86_64-${version}/lib_origin
tar -zcvf paddle2onnx-osx-x86_64-${version}.tgz paddle2onnx-osx-x86_64-${version}
- 10、回到paddle2onnx路径,产出wheel包
cd ${cur_path}
python3.9 setup_dev.py bdist_wheel
from paddle2onnx.
Mac M1 Python:
步骤1~步骤7,流程与Linux python大致相同。后续步骤中,wheel命名有些区别。
Mac M1不支持py3.6和py3.7
- 8、编译paddle2onnx
mkdir build && cd build
CMAKE_INSTALL_PREFIX=${PWD}/paddle2onnx-osx-x86_64-${version}
cmake .. -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DPYTHON_EXECUTABLE=which python
make -j12 && make install
- 9、删除不必要的临时文件。
rm -rf paddle2onnx-osx-x86_64-${version}/include/onnx
mv paddle2onnx-osx-x86_64-${version}/lib paddle2onnx-osx-x86_64-${version}/lib_origin
mkdir paddle2onnx-osx-x86_64-${version}/lib
cp -r paddle2onnx-osx-x86_64-${version}/lib_origin/libpaddle2onnx.* paddle2onnx-osx-x86_64-${version}/lib
rm -rf paddle2onnx-osx-x86_64-${version}/lib_origin
tar -zcvf paddle2onnx-osx-x86_64-${version}.tgz paddle2onnx-osx-x86_64-${version}
- 10、回到paddle2onnx路径,产出wheel包
cd ${cur_path}
python setup_dev.py bdist_wheel --plat-name=macosx_11_0_arm64
from paddle2onnx.
@Zeref996 @Aurelius84 @jiangjiajun
我在想,我们发版还是非常有必要做切分支,打tag,这样的操作的。如果不做的话,我们很难把发布出来的binary跟当时的source code对应上,这会导致定位问题的困难。
from paddle2onnx.
@Zeref996 感谢大佬,我根据你说的方案尝试一下😊
from paddle2onnx.
pypi账号相关问题可以联系 @jzhang533 。
现在我们用的账号是 https://pypi.org/user/paddle-dev/ ,我会提供协助。
from paddle2onnx.
Related Issues (20)
- (已经在issues里找过一圈答案了没有解决)faster_rcnn 转onnx 提示there are some operators not supported yet, including distribute_fpn_proposals,generate_proposals_v2 HOT 1
- ppocrv4识别模型转onnx时,修改输入shape,出现数值偏差很大的问题 HOT 1
- mask-rcnn明明我找到的issue上面显示已经支持generate_proposals_v2算子的转换了,但是我转换的时候还是提示不支持转换的op HOT 1
- Can not set input_shape when converting inference model to onnx
- paddle2onnx转化相关问题 HOT 1
- paddle2onnx 新版本 --input_shape_dict 参数提示信息 HOT 6
- No module named 'paddle2onnx.paddle2onnx_cpp2py_export' HOT 2
- wav2lip 转onnx后,生成的onnx模型输出维度变为:[-1, 3, 96, 96],而原来paddlepaddle的模型正常输出是[-1, 6, 96, 96],请问这是什么问题?
- 您好导出onnx,有没有办法导出旧的算子 HOT 15
- bilinear_interp输出shape为啥是[unk__34,unk__35,unk__36,unk__37] 我已经固定inputshape [1 3 512 512] HOT 4
- bash: paddle2onnx: command not found => How to fix it? HOT 2
- unsupported operators, including deformable_conv
- 命令行转换或导出onnx时报:ModuleNotFoundError: No module named 'paddle.fluid'
- [Announcement] Paddle2ONNX PMC Officially Established HOT 1
- onnx转rknn报错 HOT 2
- [Bug][CI] Paddle2ONNX CI目前残存Bug汇总 HOT 1
- paddle2onnx转基于rocketqa-zh-base-query-encoder训练后的模型报错:operators not supported diag_v2,kldiv_loss,
- 导出后的onnx模型依然存在动态维度的问题 HOT 3
- there are some operators not supported yet, including distribute_fpn_proposals,generate_proposals_v2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paddle2onnx.