Tencent / TNN

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.38k stars 766 forks source link

转换mobilenet-yolov3过程出错 #334

Open mitliucak opened 4 years ago

mitliucak commented 4 years ago

1.训练caffe模型,转换使用docker的方式 docker run --volume=$(pwd)/experiments/train_0812/models:/workspace -it tnn-convert:latest python3 ./converter.py caffe2tnn \ /workspace/mobilenet_yolo_deploy_pupil.prototxt \ /workspace/mobilenet_yolo_deploy_pupil.caffemodel \ -optimize \ -v v1.0

2.报错信息 google.protobuf.text_format.ParseError: 333:3 : Message type "caffe.LayerParameter" has no field named "yolov3_detection_output_param".

Oh No, caff2onnx failed :(

3.使用prototxt报错参数

layer { name: "detection_out" type: "Yolov3DetectionOutput" bottom: "conv19" top: "detection_out" include { phase: TEST } yolov3_detection_output_param { num_classes: 2 confidence_threshold: 0.009999999776482582 nms_threshold: 0.44999998807907104 biases: 10.0 biases: 14.0 biases: 23.0 biases: 27.0 biases: 37.0 biases: 58.0 biases: 100.0 biases: 105.0 biases: 150.0 biases: 150.0 biases: 344.0 biases: 319.0 anchors_scale: 32 mask_group_num: 1 mask: 3 mask: 4 mask: 5 } }

hufangjian commented 4 years ago

你这层标准的caffe不支持,TNN也不支持 。需要把detection层去掉自己用C++实现。

darrenyao87 commented 3 years ago

@gttiankai detectionoutputlayer这个层是否每个yolo版本都不一样?

gttiankai commented 3 years ago

@darrenyao87 目前来看并不是的。 caffe 的detectionoutput 只有两个版本:一个使我们实现的DetectionOutput;另一个就是yolov3_detection_output. yolov3_detection_output 实现起来比较麻烦,目前还没支持。

mitliucak commented 3 years ago

@darrenyao87 目前来看并不是的。 caffe 的detectionoutput 只有两个版本:一个使我们实现的DetectionOutput;另一个就是yolov3_detection_output. yolov3_detection_output 实现起来比较麻烦,目前还没支持。

请问 你们提供的caffe的DetectionOutput层在哪里找得到

1627180283 commented 3 years ago

@darrenyao87 目前来看并不是的。 caffe 的detectionoutput 只有两个版本:一个使我们实现的DetectionOutput;另一个就是yolov3_detection_output. yolov3_detection_output 实现起来比较麻烦,目前还没支持。

请问 你们提供的caffe的DetectionOutput层在哪里找得到

转换代码可以参考 TNN/tools/onnx2tnn/src/core/layer/onnx_converter_detection_output.cc 算子实现可以参考 TNN/source/tnn/device/cpu/acc/cpu_detection_output_layer_acc.cc