在跑DenseNet代码的时候遇到的问题

xiaoxiao2021-02-28  78

去年新出来一个DenseNet,据说效果很好,在下载好caffemodel+deploy.prototxt之后,运行predict.py出现了如下的错误

Question:https://github.com/shicai/DenseNet-Caffe/issues/10

WARNING: Logging before InitGoogleLogging() is written to STDERR W0805 10:26:38.720525 3101 _caffe.cpp:139] DEPRECATION WARNING - deprecated use of Python interface W0805 10:26:38.720546 3101 _caffe.cpp:140] Use this instead (with the named "weights" parameter): W0805 10:26:38.720549 3101 _caffe.cpp:142] Net('/home/xuy/桌面/code/python/caffe/Bag_gender_hair_classification/DenseNet_deploy_161.prototxt', 1, weights='/home/xuy/桌面/code/python/caffe/Bag_gender_hair_classification/model/DenseNet_161.caffemodel') [libprotobuf ERROR google/protobuf/text_format.cc:245] Error parsing text-format caffe.NetParameter: 54:14: Message type "caffe.PoolingParameter" has no field named "ceil_mode". F0805 10:26:38.740175 3101 upgrade_proto.cpp:88] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: /home/xuy/桌面/code/python/caffe/Bag_gender_hair_classification/DenseNet_deploy_161.prototxt *** Check failure stack trace: ***

主要的问题是:ceil_mode的问题,因此需要对于caffe源代码进行修改

解决办法:

https://github.com/BVLC/caffe/pull/3057/files

其中,include/caffe/vision_layers.hpp,由于caffe结构已经修改,没有这个文件了,经过查看之后,发现该文件是:/home/xuy/caffe/include/caffe/layers/pooling_layer.hpp

在这里面进行修改即可

其他的照着代码加即可

转载请注明原文地址: https://www.6miu.com/read-26404.html

最新回复(0)