Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

尝试转化了下MobileNetV2-YOLOv3-Nano-voc到NCNN,报错has no field named "upsample_param" #8

Open
flyboy114 opened this issue Jul 1, 2020 · 10 comments

Comments

@flyboy114
Copy link

使用了最新的NCNN,但项目里面MobileNetV2-YOLOv3-Nano-voc模型还是无法转化,报错:

(py35) qglobal@qglobal-ThinkStation-P328:~/ncnn/build/tools/caffe$ ./caffe2ncnn MobileNetV2-YOLOv3-Nano-voc.prototxt MobileNetV2-YOLOv3-Nano-voc.caffemodel
[libprotobuf ERROR google/protobuf/text_format.cc:274] Error parsing text-format caffe.NetParameter: 2066:20: Message type "caffe.LayerParameter" has no field named "upsample_param".
read_proto_from_text failed

大佬,你这个表里模型测试的NCNN模型是咋转化的

Network VOC mAP(0.5) COCO mAP(0.5) Resolution Inference time (NCNN/Kirin 990) Inference time (MNN arm82/Kirin 990) FLOPS Weight size
MobileNetV2-YOLOv3-Lite 72.61 36.57 320 31.58 ms 18 ms 1.8BFlops 8.0MB
MobileNetV2-YOLOv3-Nano 65.27 30.13 320 13 ms 5 ms 0.5BFlops 3.0MB
YOLOv3-Tiny-Prn & 33.1 416 36.6 ms & ms 3.5BFlops 18.8MB
YOLO-Nano 69.1 & 416 & ms & ms 4.57BFlops 4.0MB
@dog-qiuqiu
Copy link
Owner

dog-qiuqiu commented Jul 1, 2020

https://github.com/Tencent/ncnn/tree/master/tools/darknet
直接cfg和weights转啊,不用转成caffe的格式,MNN得先darknet2caffe,在caffe2mnn,NCNN支持darknet模型直接转换
cd ~/ncnn/build/tools/darknet
./darknet2ncnn MobileNetV2-YOLOv3-Nano-voc.cfg MobileNetV2-YOLOv3-Nano-voc.weights
还有你转换ncnn的param和bin格式后,记得再用ncnnoptimize合并BN层,还不懂的话+qq群

@flyboy114
Copy link
Author

成功了,感谢大佬!!!

@gttiankai
Copy link

今天刚刚在TNN的模型转换里面支持了这个模型。哈哈,有兴趣可以试一下。
https://github.com/Tencent/TNN

@dog-qiuqiu
Copy link
Owner

@gttiankai 大佬,我是直接Darkne2Caffe转成caffe模型在转成TNN格式吗?

@gttiankai
Copy link

是的,需要先转换成caffe。 我使用https://github.com/dog-qiuqiu/MobileNetv2-YOLOV3/tree/master/darknet2caffe/sample 这个里面的caffe模型测试。

@dog-qiuqiu
Copy link
Owner

@gttiankai 好的,谢谢啦,我试试啦

@flyboy114
Copy link
Author

@gttiankai @dog-qiuqiu 用了https://github.com/dog-qiuqiu/MobileNetv2-YOLOV3/tree/master/darknet2caffe/sample 里面的模型转化完后生成的.tnnproto里面似乎没有scores和boxes,似乎没有输出层。

MobileNetV2-YOLOv3-Nano-voc.tnnproto.txt

@dog-qiuqiu
Copy link
Owner

@flyboy114 Tnn yolo后处理得自个写,它只负责输出featuremap

@flyboy114
Copy link
Author

@dog-qiuqiu 我用了Netron看了下转化后的模型,是将layer69-conv和layer79-conv作为最后的featuremap吧
version-slim-320_simplified

@dog-qiuqiu
Copy link
Owner

是的呀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants