Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upError in python interface. " Net.__init__(Net, str, str, int) did not match C++ signature" #3220
Comments
This comment has been minimized.
This comment has been minimized.
Well, I solved this problem.
to
And it's normal now. |
suruoxi
changed the title
Error in python interface.
Error in python interface. " Net.__init__(Net, str, str, int) did not match C++ signature"
Oct 21, 2015
suruoxi
closed this
Oct 21, 2015
This comment has been minimized.
This comment has been minimized.
ry
commented
Jan 21, 2016
I hit this same error in Jan 2016. @suruoxi's fix seems to work. diff --git a/python/caffe/_caffe.cpp b/python/caffe/_caffe.cpp
index 4ea2ec6..4c558cb 100644
--- a/python/caffe/_caffe.cpp
+++ b/python/caffe/_caffe.cpp
@@ -75,7 +75,7 @@ void CheckContiguousArray(PyArrayObject* arr, string name,
// Net constructor for passing phase as int
shared_ptr<Net<Dtype> > Net_Init(
- string param_file, int phase) {
+ char* param_file, int phase) {
CheckFile(param_file);
shared_ptr<Net<Dtype> > net(new Net<Dtype>(param_file,
@@ -85,7 +85,7 @@ shared_ptr<Net<Dtype> > Net_Init(
// Net construct-and-load convenience constructor
shared_ptr<Net<Dtype> > Net_Init_Load(
- string param_file, string pretrained_param_file, int phase) {
+ char* param_file, char* pretrained_param_file, int phase) {
CheckFile(param_file);
CheckFile(pretrained_param_file); Maybe has something to do with differing versions of Boost? Please reopen this issue |
This comment has been minimized.
This comment has been minimized.
codegeniur
commented
Mar 26, 2016
Hi, I've the same error too and did the above but it didn't work.
|
This comment has been minimized.
This comment has been minimized.
Mithul
commented
Apr 30, 2016
•
Running Ubuntu 15.10 and receive the same error on the ipython example 00 net = caffe.Net(model_def, # defines the structure of the model
model_weights, # contains the trained weights
caffe.TEST) # use test mode (e.g., don't perform dropout)
the above fix does not work for me |
This comment has been minimized.
This comment has been minimized.
If you take a careful look at the error message, the constructor is expecting strings for the first two arguments. What are the |
This comment has been minimized.
This comment has been minimized.
kscottz
commented
Jun 27, 2016
I ran into this issue recent. I found that just wrapping the input args with str() seemed to get the function signature to match. I.e.
|
This comment has been minimized.
This comment has been minimized.
You may be using Python 3/from future import unicode_literals, in which case wrapping with str() works. |
This comment has been minimized.
This comment has been minimized.
groakat
commented
Aug 19, 2016
•
I had this problem, because I had |
This comment has been minimized.
This comment has been minimized.
kravchyuriy
commented
Jan 4, 2017
•
Reinstalling latest version of Boost from sources resolved that problem for me (Ubuntu 16). |
This comment has been minimized.
This comment has been minimized.
isn4
commented
Apr 2, 2017
Since this seems to be a boost error, what version of boost is everyone running? |
This comment has been minimized.
This comment has been minimized.
DaliaMarzouk
commented
May 27, 2017
Any one could solve this problem. I am facing the same error and tried many solutions without a luck |
This comment has been minimized.
This comment has been minimized.
atakemura
commented
Jun 14, 2017
•
Encountered this error today, solved by installing the latest boost from source. Ubuntu 16.04, anaconda3, Python 3.6, CUDA 8, Boost 1.64
Additionally, to get
I encountered this error in examples/00-classification.ipynb, where it tried to load trained net/weight with caffe.Net(...). |
This comment has been minimized.
This comment has been minimized.
aniket03
commented
Jun 22, 2017
•
@suruoxi I also faced the same issue and tried the solution you have stated but it didn't work out for me. Do we also need to compile _caffe.cpp again here. I can see a file _caffe.so thought it might be related. ^ Sorted just had to run make pycaffe for it to be compiled again. Thanks for the solution though |
sainisanjay
referenced this issue
Jul 3, 2017
Closed
extract_weights.py.....did not match C++ signature: #2
This comment has been minimized.
This comment has been minimized.
flyinskyin2013
commented
May 25, 2018
•
I use above way to slove my same problem. |
This comment has been minimized.
This comment has been minimized.
kr11
commented
Sep 20, 2018
as @suruoxi said, in the newest version of |
suruoxi commentedOct 20, 2015
I tried to init a net with the python code:
The following error is reported:
I think the python interface is compatible with C++ signature. Then why is this error reported?
OpenSuse 13.02 64bit