TNN: developed by Tencent Youtu Lab and Guangying Lab, a uniform deep learning inference framework for mobile、desktop and server. TNN is distinguished by several outstanding features, including its cross-platform capability, high performance, model compression and code pruning. Based on ncnn and Rapidnet, TNN further strengthens the support and performance optimization for mobile devices, and also draws on the advantages of good extensibility and high performance from existed open source efforts. TNN has been deployed in multiple Apps from Tencent, such as Mobile QQ, Weishi, Pitu, etc. Contributions are welcome to work in collaborative with us and make TNN a better framework.
Other
4.41k
stars
771
forks
source link
onnx转tnn,No module named 'onnx2tnn.onnx_optimizer #803
[ 0%] Generating proto/onnx.pb.h, proto/onnx.pb.cc
[ 1%] Building CXX object CMakeFiles/onnx2tnn.dir/onnx2tnn_convert.cc.o
[ 2%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/half/half_utils.cc.o
[ 3%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_abs.cc.o
[ 4%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_acos.cc.o
[ 5%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_add.cc.o
[ 5%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_arg_max_or_min.cc.o
[ 6%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_asin.cc.o
[ 7%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_atan.cc.o
[ 8%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_batchnorm.cc.o
[ 9%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_cast.cc.o
[ 10%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_ceil.cc.o
[ 11%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_clip.cc.o
[ 11%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_concat.cc.o
[ 12%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_const.cc.o
[ 13%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_convolution.cc.o
[ 14%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_cos.cc.o
[ 15%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_depthtospace.cc.o
[ 16%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_detection_output.cc.o
[ 17%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_div.cc.o
[ 17%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_dropout.cc.o
[ 18%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_elu.cc.o
[ 19%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_exp.cc.o
[ 20%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_flatten.cc.o
[ 21%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_floor.cc.o
[ 22%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_gather.cc.o
[ 23%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_gemm.cc.o
[ 23%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_hard_sigmoid.cc.o
[ 24%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_hard_swish.cc.o
[ 25%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_hdrguide.cc.o
[ 26%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_instance_norm.cc.o
[ 27%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_leakyrelu.cc.o
[ 28%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_log.cc.o
[ 29%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_logsigmoid.cc.o
[ 29%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_lp_normalization.cc.o
[ 30%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_lrn.cc.o
[ 31%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_matmul.cc.o
[ 32%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_max.cc.o
[ 33%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_min.cc.o
[ 34%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_mul.cc.o
[ 35%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_multidir_broadcast.cc.o
[ 35%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_neg.cc.o
[ 36%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_normalize.cc.o
[ 37%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_pad.cc.o
[ 38%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_pixel_shuffle.cc.o
[ 39%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_pool.cc.o
[ 40%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_pow.cc.o
[ 41%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_prelu.cc.o
[ 41%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_prior_box.cc.o
[ 42%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_reciprocal.cc.o
[ 43%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_reduce.cc.o
[ 44%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_relu.cc.o
[ 45%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_reshape.cc.o
[ 46%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_resize.cc.o
[ 47%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_selu.cc.o
[ 47%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_shape.cc.o
[ 48%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_shuffle_channel.cc.o
[ 49%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_sigmoid.cc.o
[ 50%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_sign.cc.o
[ 51%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_signed_mul.cc.o
[ 52%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_sin.cc.o
[ 52%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_slice.cc.o
[ 53%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_softmax.cc.o
[ 54%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_softplus.cc.o
[ 55%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_split.cc.o
[ 56%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_sqrt.cc.o
[ 57%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_squeeze.cc.o
[ 58%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_sub.cc.o
[ 58%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_tan.cc.o
[ 59%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_tanh.cc.o
[ 60%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_tile.cc.o
[ 61%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_transpose.cc.o
[ 62%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_unsqueeze.cc.o
[ 63%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_converter_upsample.cc.o
[ 64%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/layer/onnx_op_converter.cc.o
[ 64%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx2tnn.cc.o
[ 65%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx2tnn_model.cc.o
[ 66%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_batchnorm.cc.o
[ 67%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_conv.cc.o
[ 68%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_deconv.cc.o
[ 69%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_depth_to_space.cc.o
[ 70%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_flatten.cc.o
[ 70%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_gemm.cc.o
[ 71%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_global_average_pool.cc.o
[ 72%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_hard_sigmoid.cc.o
[ 73%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_hard_swish.cc.o
[ 74%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_hdr_guide.cc.o
[ 75%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_instance_normalization.cc.o
[ 76%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_logsigmoid.cc.o
[ 76%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_matmul.cc.o
[ 77%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_normalize.cc.o
[ 78%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_pooling.cc.o
[ 79%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_prelu.cc.o
[ 80%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_relu6.cc.o
[ 81%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_shuffle_channel.cc.o
[ 82%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_signed_mul.cc.o
[ 82%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_softmax.cc.o
[ 83%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_fuse_spacetodepth.cc.o
[ 84%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_transfer_global_max_pool.cc.o
[ 85%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_transfer_input_name.cc.o
[ 86%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_fuse/onnx2tnn_transfer_reduce_max.cc.o
[ 87%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_process_tf/onnx2tnn_remove_transpose.cc.o
[ 88%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_process_tf/onnx2tnn_transfer_concat.cc.o
[ 88%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_process_tf/onnx2tnn_transfer_split.cc.o
[ 89%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_remove/onnx2tnn_remove_concat.cc.o
[ 90%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_remove/onnx2tnn_remove_dropout.cc.o
[ 91%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_remove/onnx2tnn_remove_expand.cc.o
[ 92%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_remove/onnx2tnn_remove_image_scaler.cc.o
[ 93%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_remove/onnx2tnn_remove_pad.cc.o
[ 94%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_remove/onnx2tnn_remove_pool.cc.o
[ 94%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_remove/onnx2tnn_remove_reshape.cc.o
[ 95%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_remove/onnx2tnn_remove_split_unsqueeze_concat.cc.o
[ 96%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_remove/onnx2tnn_remove_squeeze.cc.o
[ 97%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_remove/onnx2tnn_remove_unsqueeze.cc.o
[ 98%] Building CXX object CMakeFiles/onnx2tnn.dir/data/Framework/TNN/tools/onnx2tnn/src/core/onnx_utility.cc.o
[ 99%] Building CXX object CMakeFiles/onnx2tnn.dir/proto/onnx.pb.cc.o
[100%] Linking CXX shared module onnx2tnn.cpython-38-x86_64-linux-gnu.so
[100%] Built target onnx2tnn
5. 详细描述bug 情况 (Describe the bug)
No module named 'onnx2tnn.onnx_optimizer'; 'onnx2tnn' is not a package
6. 运行日志(runtime log)
(base) ubuntu@elcnlhdcgpu03:/data/Framework/TNN/tools/onnx2tnn/onnx-converter$ python onnx2tnn.py /data/Framework/TNN/xin_demo/yolov4_1_3_416_416_static.onnx -version=v1.0 -optimize=1 -half=0 -o /data/Framework/TNN/xin_demo/ -input_shape input:1,3,416,416
0.----onnx version:1.4.1
algo_optimize 1
onnx_net_opt_path /data/Framework/TNN/xin_demo/yolov4_1_3_416_416_static.opt.onnx
1.----onnx_optimizer: /data/Framework/TNN/xin_demo/yolov4_1_3_416_416_static.onnx
Traceback (most recent call last):
File "onnx2tnn.py", line 41, in do_optimize
import onnx2tnn.onnx_optimizer.onnx_optimizer as opt
ModuleNotFoundError: No module named 'onnx2tnn.onnx_optimizer'; 'onnx2tnn' is not a package
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "onnx2tnn.py", line 140, in <module>
main()
File "onnx2tnn.py", line 120, in main
do_optimize(onnx_net_path, input_shape)
File "onnx2tnn.py", line 43, in do_optimize
import onnx_optimizer.onnx_optimizer as opt
File "/data/Framework/TNN/tools/onnx2tnn/onnx-converter/onnx_optimizer/onnx_optimizer.py", line 13, in <module>
from onnxsim import onnx_simplifier
ModuleNotFoundError: No module named 'onnxsim'
1. 环境(environment)
RunTime OS Version: Linux
2. Github版本
commit(optional):
3. 编译方式(compile method) github上的自动编译
4. 编译日志(build log)
5. 详细描述bug 情况 (Describe the bug)
No module named 'onnx2tnn.onnx_optimizer'; 'onnx2tnn' is not a package
6. 运行日志(runtime log)
7. 截图(Screenshots)