【问题标题】:Caffe error: can't use pretrained prototxt and caffemodel with caffe.NetCaffe 错误:无法将预训练的 prototxt 和 caffemodel 与 caffe.Net 一起使用
【发布时间】:2020-08-16 08:54:57
【问题描述】:

我想使用来自here 的 DEX 训练网络。但是当我使用时遇到以下问题

net = caffe.Net('dex_imdb_wiki.caffemodel', 1, weights='age.prototxt')

这是错误日志:

[libprotobuf ERROR google/protobuf/text_format.cc:307] 解析文本格式 caffe.NetParameter: 2:1: 文本中遇到无效控制字符时出错。

[libprotobuf ERROR google/protobuf/text_format.cc:307] 解析文本格式 caffe.NetParameter 时出错:2:22:解释非 ascii 代码点 162。

[libprotobuf ERROR google/protobuf/text_format.cc:307] 解析文本格式 caffe.NetParameter 时出错:2:22:消息类型“caffe.NetParameter”没有名为“VGG_ILSVRC_16_layers”的字段。

警告:在将 InitGoogleLogging() 写入 STDERR 之前进行日志记录

F0501 15:41:00.689872 5795 upgrade_proto.cpp:90] 检查失败:ReadProtoFromTextFile(param_file, param) 无法解析 NetParameter 文件:gender.caffemodel * 检查失败堆栈跟踪:*

我使用的是 Ubuntu 20.04 LTS 和 python 3.8.2。

【问题讨论】:

    标签: caffe python-3.8 ubuntu-20.04


    【解决方案1】:

    我发现了错误。 只需将参数顺序更改为

    net = caffe.Net('age.prototxt', 1, weights='dex_imdb_wiki.caffemodel')
    

    【讨论】:

      猜你喜欢
      • 2017-04-20
      • 2016-09-23
      • 2016-10-06
      • 2015-11-28
      • 1970-01-01
      • 2016-07-27
      • 2016-07-30
      • 1970-01-01
      • 2015-02-12
      相关资源
      最近更新 更多