Toybrick

标题: 自定义算子生成失败 [打印本页]

作者: liufeng    时间: 2020-8-3 16:12
标题: 自定义算子生成失败
toybrick@debian10:~/rknn-toolkit-v1.3.2/examples/common_function_demos/custom_op/ts$ python3 -m rknn.bin.custom_op --action build --op_path ./resize_area
W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/handlers/backend/ceil.py:10: The name tf.ceil is deprecated. Please use tf.math.ceil instead.

W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/handlers/backend/depth_to_space.py:12: The name tf.depth_to_space is deprecated. Please use tf.compat.v1.depth_to_space instead.

W:tensorflow:
The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
  * https://github.com/tensorflow/co ... 7-contrib-sunset.md
  * https://github.com/tensorflow/addons
  * https://github.com/tensorflow/io (for I/O related ops)
If you depend on functionality not listed there, please file an issue.

W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/handlers/backend/log.py:10: The name tf.log is deprecated. Please use tf.math.log instead.

W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/handlers/backend/random_normal.py:9: The name tf.random_normal is deprecated. Please use tf.random.normal instead.

W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/handlers/backend/random_uniform.py:9: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/handlers/backend/upsample.py:13: The name tf.image.resize_images is deprecated. Please use tf.image.resize instead.

/home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/common/__init__.py:87: UserWarning: FrontendHandler.get_outputs_names is deprecated. It will be removed in future release.. Use node.outputs instead.
  warnings.warn(message)
checking aarch64-linux-gnu
found /home/toybrick/.rknn/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu
building library
if [ ! -d ./.out/x64 ]; then mkdir -p ./.out/x64; else echo "./.out/x64 exist"; fi
./.out/x64 exist
cc -fPIC -shared -I/home/toybrick/.local/lib/python3.7/site-packages/rknn/simulator/include -L/home/toybrick/openvx_sample/install/Linux/x64/Release/bin -lopenvx -Wl,--no-as-needed -o ./.out/x64/libresizearea.so rknn_kernel_resizearea.c
build x64 library success
if [ ! -d ./.out/aarch64 ]; then mkdir -p ./.out/aarch64; else echo "./.out/aarch64 exist"; fi
./.out/aarch64 exist
aarch64-linux-gnu-gcc -fPIC -shared -I/home/toybrick/.local/lib/python3.7/site-packages/rknn/simulator/include -L/home/toybrick/.local/lib/python3.7/site-packages/rknn/simulator/lib/aarch64_linux -Wl,--no-as-needed -lOpenVX -o ./.out/aarch64/libresizearea.so rknn_kernel_resizearea.c
build aarch64 library success
building vx kernel source
/bin/sh: 1: /home/toybrick/.local/lib/python3.7/site-packages/rknn/simulator/bin/vcCompiler: Exec format error
build vx kernel source fail


作者: liufeng    时间: 2020-8-3 16:17
/bin/sh: 1: /home/toybrick/.local/lib/python3.7/site-packages/rknn/simulator/bin/vcCompiler: Exec format error 提示出错,大致是什么原因
作者: jefferyzhang    时间: 2020-8-3 20:49
simulator 是pcx86 模拟arm的程序,你需要在pc版本的rknntoolkit运行。板子上不支持自定义算子开发。
详细请参看文档。
作者: liufeng    时间: 2020-8-4 17:39
jefferyzhang 发表于 2020-8-3 20:49
simulator 是pcx86 模拟arm的程序,你需要在pc版本的rknntoolkit运行。板子上不支持自定义算子开发。
详细 ...

好的,谢谢。我使用相同的编译流程在PC linux上可以正常编译生成.rknnop。确实是还不支持板子上debain系统里编译自定义操作,存在不兼容。PC上能生成。
作者: liufeng    时间: 2020-8-4 17:42
(RKNN_TOOL) root@liufeng-VirtualBox:/media/sf_VirtualBoxShareDir/common_function_demos/custom_op/ts# python3 -m rknn.bin.custom_op --action build --op_path ./resize_area
checking aarch64-linux-gnu
found /root/.rknn/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu
found /root/.rknn/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf
building library
if [ ! -d ./.out/x64 ]; then mkdir -p ./.out/x64; else echo "./.out/x64 exist"; fi
cc -fPIC -shared -I/root/anaconda3/envs/RKNN_TOOL/lib/python3.6/site-packages/rknn/simulator/LION/include -L/root/anaconda3/envs/RKNN_TOOL/lib/python3.6/site-packages/rknn/simulator/LION/lib/x64_linux -Wl,--no-as-needed -lOpenVX -o ./.out/x64/libresizearea.so rknn_kernel_resizearea.c
build x64 library success
if [ ! -d ./.out/aarch64 ]; then mkdir -p ./.out/aarch64; else echo "./.out/aarch64 exist"; fi
/root/.rknn/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc -fPIC -shared -I/root/anaconda3/envs/RKNN_TOOL/lib/python3.6/site-packages/rknn/simulator/LION/include -L/root/anaconda3/envs/RKNN_TOOL/lib/python3.6/site-packages/rknn/simulator/LION/lib/aarch64_linux -Wl,--no-as-needed -lOpenVX -o ./.out/aarch64/libresizearea.so rknn_kernel_resizearea.c
build aarch64 library success
if [ ! -d ./.out/armhf ]; then mkdir -p ./.out/armhf; else echo "./.out/armhf exist"; fi
/root/.rknn/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -fPIC -shared -I/root/anaconda3/envs/RKNN_TOOL/lib/python3.6/site-packages/rknn/simulator/LION/include -L/root/anaconda3/envs/RKNN_TOOL/lib/python3.6/site-packages/rknn/simulator/LION/lib/armhf_linux -Wl,--no-as-needed -lOpenVX -o ./.out/armhf/libresizearea.so rknn_kernel_resizearea.c
build armhf library success
building vx kernel source
(4:0) : warning : kernel function : 'resizearea' is empty

build vx kernel source success
generate ResizeArea.rknnop success

PC linux 下编译生成成功。




欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3