File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,6 +85,12 @@ python3 -m pip install git+https://github.com/MegEngine/mgeconvert.git@v0.4.2 --
8585--install-option=" --targets=tflite --tfversion=r2.4"
8686```
8787
88+ ` tflite ` 转换器依赖的 ` libflatbuffers.so ` 位于 ` $HOME/.local/lib ` 下,使用前需要执行:
89+
90+ ``` bash
91+ export LD_LIBRARY_PATH=$HOME /.local/lib:$LD_LIBRARY_PATH
92+ ```
93+
8894### 源代码安装
8995
9096安装选项说明同上,以 caffe 为例,下面的命令将安装0.4.2版本的caffe转换器:
@@ -231,6 +237,17 @@ error removing /home/user/.local/lib/python3.6/site-packages/mgeconvert-0.5.0-py
231237sudo pip3 uninstall mgeconvert
232238```
233239
240+ 2 . 使用` tflite ` 转换器时` fbconverter.so ` 出现 ` undefined symbol ` 错误:
241+
242+ ```
243+ ImportError: /home//lib/python3.6/site-packages/mgeconvert/backend/ir_to_tflite/pyflexbuffers/fbconverter.so: undefined symbol: _ZN11flatbuffers13ClassicLocale9instance_E
244+ ```
245+ 这是链接的` libflatbuffers.so ` 版本和依赖版本不一致导致的问题,执行以下命令使用` mgeconvert ` 编译的` libflatbuffers.so ` :
246+
247+ ``` bash
248+ export LD_LIBRARY_PATH=$HOME /.local/lib:$LD_LIBRARY_PATH
249+ ```
250+
234251## 算子支持列表
235252
236253| tracemodule:rocket : <br />mgo:fire : | TFLite | Caffe | ONNX |
Original file line number Diff line number Diff line change 11#! /bin/bash -e
22
3- python3 -m pip install --no-binary=protobuf protobuf> =3.11.1 --user
3+ python3 -m pip install --no-binary=protobuf " protobuf>=3.11.1" --user
44
55hash wget || (echo " please install wget package" && exit -1)
66hash protoc || (echo " please install protobuf-compiler package" && exit -1)
Original file line number Diff line number Diff line change 11#! /bin/bash -e
22
3- python3 -m pip install onnx> =1.7.0 --user
3+ python3 -m pip install " onnx>=1.7.0" --user
44python3 -m pip install onnxoptimizer --user
55python3 -m pip install protobuf --user
Original file line number Diff line number Diff line change 1717
1818TMP_DIR=" /tmp/mgeconvert/flatbuffers"
1919
20- if [[ " $FLATC_VERSION " != " flatc version 1.12.0" || " $FLAT_BUFFER_VERSION " != " Version: 1.12" ]]; then
20+ if [[ ! -L " $HOME /.local/lib/libflatbuffers.so " || " $FLATC_VERSION " != " flatc version 1.12.0" || " $FLAT_BUFFER_VERSION " != " Version: 1.12" ]]; then
2121 rm -rf $TMP_DIR
2222 git clone https://github.com/google/flatbuffers.git -b v1.12.0 $TMP_DIR
2323fi
2424
25- if [[ " $FLATC_VERSION " != " flatc version 1.12.0" ]]; then
26- python3 -m pip uninstall flatbuffers -y
25+ if [[ ! -L " $HOME /.local/lib/libflatbuffers.so" || " $FLATC_VERSION " != " flatc version 1.12.0" ]]; then
2726 rm -rf $HOME /.local/bin/flatc
2827 rm -rf $HOME /.local/lib/libflatbuffers*
2928 # build flatbuffers
@@ -69,4 +68,4 @@ PYTHON_STDLIB=$(python3 -c "import sysconfig; print(sysconfig.get_paths()['stdli
6968
7069g++ fbconverter.cc --std=c++14 -fPIC --shared -I$HOME /.local/include -I${PYBIND11_HEADER} -I${PYTHON_INCLUDE} -L${PYTHON_STDLIB} -L$HOME /.local/lib -lflatbuffers -o fbconverter.so
7170
72- rm -r /tmp/mgeconvert
71+ rm -rf /tmp/mgeconvert
You can’t perform that action at this time.
0 commit comments