Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract_weights.py.....did not match C++ signature: #2

Closed
sainisanjay opened this issue Jul 3, 2017 · 4 comments
Closed

extract_weights.py.....did not match C++ signature: #2

sainisanjay opened this issue Jul 3, 2017 · 4 comments

Comments

@sainisanjay
Copy link

sainisanjay commented Jul 3, 2017

Hi all, @pekala, @cash @j6k4m8 @wrgr @griffinmilsap @cratto
I am trying to run extract_weights.py to save the weights in file but i an getting error as below. I have tried #BVLC/caffe#3220 but no luck. I am using:
platform : linux-64
conda version : 4.3.21
conda-env version : 4.3.21
python version : 2.7.13.final.0


> .....python ./extract_weights.py -m lenet_tn_iter_30000.caffemodel -n lenet_tn.prototxt

Traceback (most recent call last):
  File "./extract_weights.py", line 26, in <module>
    net = caffe.Net(args.netFile, args.modelFile)
Boost.Python.ArgumentError: Python argument types in
    Net.__init__(Net, str, str)
did not match C++ signature:
    __init__(boost::python::api::object, std::string, std::string, int)
    __init__(boost::python::api::object, std::string network_file, int phase, int level=0, boost::python::api::object stages=None, boost::python::api::object weights=None)

Any idea???

@cash
Copy link
Member

cash commented Jul 3, 2017

Looks like the pycaffe API changed for Net between 1.0rc1 and 1.0rc2. Try changing line 26 of extract_weights.py to

net = caffe.Net(args.netFile, args.modelFile, caffe.TRAIN)

I'm not that familiar with this code so it may be that you need to use caffe.TEST instead. Also you may run into other version incompatibilities.

@mjpekala
Copy link
Collaborator

mjpekala commented Jul 3, 2017

Hi sainisanjay,
I would also mention that this code is pretty old and isn't actively used as far as I'm aware. If you are interested in processing neurodata I would suggest you take a look at https://neurodata.io and https://neurodata.io/tools/ndparse/. If you are interested in semantic segmentation in general you will probably be better off with a more modern algorithm, e.g. see https://arxiv.org/abs/1505.04597.

@sainisanjay
Copy link
Author

Hi @cash and @mjpekala,
Actually, i just want to extract the weights from my trained caffe model thus i tried to used yours code (extract_weights.py). But, unfortunately its doesn't working with current Caffe. BTW, thanks to both of you for your support and suggestions. If you have some other code which can extract the weights from latest caffe please let me know. Thanks

@cash cash closed this as completed Jul 3, 2017
@sainisanjay
Copy link
Author

Hi @cash, Thanks for your suggestion, caffe.TEST works for me. First i update my Boost version to 1.60.0 and than it worked. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants