Caffe – Deprecation warning

Depending upon application, you may find that Caffe is showing following warning:

W1119 09:42:45.634932 11888 _caffe.cpp:139] DEPRECATION WARNING - deprecated use of Python interface
W1119 09:42:45.634954 11888 _caffe.cpp:140] Use this instead (with the named "weights" parameter):
W1119 09:42:45.634958 11888 _caffe.cpp:142] Net('deploy.prototxt', 1, weights='bvlc_reference_caffenet.caffemodel')
I1119 09:42:45.636143 11888 net.cpp:53] Initializing net from parameters:

At the time writing this text, Caffe (https://github.com/BVLC/caffe/commit/99bd99795dcdf0b1d3086a8d67ab1782a8a08383) sample applications are also showing this warning.


It happens because caffe.Net interface parameters are not passed correctly:

net = caffe.Net(prototxt_file, weight_file, caffe.TEST)

To fix this warning, parameters passed to caffe.Net needs shuffling

net = caffe.Net(prototxt_file, caffe.TEST, weights=weight_file)