user12879007
user12879007

Reputation:

Caffe error: can't use pretrained prototxt and caffemodel with caffe.Net

I want to use DEX trained net from here. But I'm having the following problem, when I use

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

This is the error log:

[libprotobuf ERROR google/protobuf/text_format.cc:307] Error parsing text-format caffe.NetParameter: 2:1: Invalid control characters encountered in text.

[libprotobuf ERROR google/protobuf/text_format.cc:307] Error parsing text-format caffe.NetParameter: 2:22: Interpreting non ascii codepoint 162.

[libprotobuf ERROR google/protobuf/text_format.cc:307] Error parsing text-format caffe.NetParameter: 2:22: Message type "caffe.NetParameter" has no field named "VGG_ILSVRC_16_layers".

WARNING: Logging before InitGoogleLogging() is written to STDERR

F0501 15:41:00.689872 5795 upgrade_proto.cpp:90] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: gender.caffemodel * Check failure stack trace: *

I'm using Ubuntu 20.04 LTS and python 3.8.2.

Upvotes: 0

Views: 1175

Answers (1)

user12879007
user12879007

Reputation:

I've figured out the error. Just change the parameters order to

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

Upvotes: 0

Related Questions