From the documentation, I thought there was a constructor taking a NetParameter argument,
Explicit Net (const NetParameter & param);
but when I try to use it like this:
import caffe from caffe import layers as L from google.protobuf import text_format def logreg(hdf5, batch_size):
Below is the error in ipython
<class 'caffe.proto.caffe_pb2.NetParameter'> --------------------------------------------------------------------------- ArgumentError Traceback (most recent call last) <ipython-input-20-edce76ff13a1> in <module>() 14 15 print type(net_param); ---> 16 caffe.Net(net_param, caffe.TEST) ArgumentError: Python argument types in Net.__init__(Net, NetParameter, int) did not match C++ signature: __init__(boost::python::api::object, std::string, std::string, int) __init__(boost::python::api::object, std::string, int)
So what am I doing wrong here? How to use this constructor?
Note. I know how to use the "read file from disk constructor" already, I want to use NetParameter alone or understand why it does not work.
Edit after Shai comment:
I purchased caffe using this command on July 26, 2015: git clone https://github.com/BVLC/caffe.git
Here is the file on my disk:
~/caffe/src/caffe$ grep NetParameter net.cpp | head -1 Net<Dtype>::Net(const NetParameter& param) { ~/caffe/src/caffe$ ~/caffe/build/tools/caffe -version caffe
The -version switch does not work. I grepped through the source and could not find the version number.