Fixbug #3494 No to_python (by-value) converter found for C++ t…#3575
Conversation
…ype: boost::shared_ptr<caffe::Blob<float> >
|
what is label JL? @shelhamer |
|
It would be nice if this were merged. I'm having to merge it manually by hand to build on OS X, since Homebrew is packaging boost 1.60.0. |
|
@errord @crowsonkb Sorry, I can't reproduce this in |
|
I've also run into this. There is no error at build time but you can reproduce it by running tests. Specifically - Without this patch: With: |
|
I think I just reproduced the problem in #3575 on master with #3570 and #3613 applied (the latter two may not be relevant). When I applied #3575 I was able to continue on. Here is the trace: Traceback (most recent call last): ± python --version /usr/local/Cellar/boost/1.60.0_1 (11,059 files, 123.0M) * |
|
@shelhamer I hope this commit can be merged, because I also run into this problem, and my environment is Mac OS X 10.11.3, Xcode 7.2, Anaconda python 2.7.11, boost 1.6.0. I verified and confirmed that the error below can be fixed by applying this commit. ======================================================================
ERROR: test_forward_backward (test_net.TestNet)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ylzhao/Project/caffe/python/caffe/test/test_net.py", line 45, in setUp
size=self.net.blobs['label'].data.shape)
File "caffe/pycaffe.py", line 28, in _Net_blobs
return OrderedDict(zip(self._blob_names, self._blobs))
TypeError: No to_python (by-value) converter found for C++ type: boost::shared_ptr<caffe::Blob<float> >
======================================================================
ERROR: test_inputs_outputs (test_net.TestNet)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ylzhao/Project/caffe/python/caffe/test/test_net.py", line 45, in setUp
size=self.net.blobs['label'].data.shape)
File "caffe/pycaffe.py", line 28, in _Net_blobs
return OrderedDict(zip(self._blob_names, self._blobs))
TypeError: No to_python (by-value) converter found for C++ type: boost::shared_ptr<caffe::Blob<float> >
======================================================================
ERROR: test_memory (test_net.TestNet)
Check that holding onto blob data beyond the life of a Net is OK
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ylzhao/Project/caffe/python/caffe/test/test_net.py", line 45, in setUp
size=self.net.blobs['label'].data.shape)
File "caffe/pycaffe.py", line 28, in _Net_blobs
return OrderedDict(zip(self._blob_names, self._blobs))
TypeError: No to_python (by-value) converter found for C++ type: boost::shared_ptr<caffe::Blob<float> >
======================================================================
ERROR: test_save_and_read (test_net.TestNet)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ylzhao/Project/caffe/python/caffe/test/test_net.py", line 45, in setUp
size=self.net.blobs['label'].data.shape)
File "caffe/pycaffe.py", line 28, in _Net_blobs
return OrderedDict(zip(self._blob_names, self._blobs))
TypeError: No to_python (by-value) converter found for C++ type: boost::shared_ptr<caffe::Blob<float> >
======================================================================
ERROR: test_net_memory (test_solver.TestSolver)
Check that nets survive after the solver is destroyed.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ylzhao/Project/caffe/python/caffe/test/test_solver.py", line 29, in setUp
size=self.solver.net.blobs['label'].data.shape)
TypeError: No to_python (by-value) converter found for C++ type: boost::shared_ptr<caffe::Net<float> >
======================================================================
ERROR: test_snapshot (test_solver.TestSolver)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ylzhao/Project/caffe/python/caffe/test/test_solver.py", line 29, in setUp
size=self.solver.net.blobs['label'].data.shape)
TypeError: No to_python (by-value) converter found for C++ type: boost::shared_ptr<caffe::Net<float> >
======================================================================
ERROR: test_solve (test_solver.TestSolver)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ylzhao/Project/caffe/python/caffe/test/test_solver.py", line 29, in setUp
size=self.solver.net.blobs['label'].data.shape)
TypeError: No to_python (by-value) converter found for C++ type: boost::shared_ptr<caffe::Net<float> >
----------------------------------------------------------------------
Ran 21 tests in 1.499s |
|
Ok, I have reproduced the problem and the fix. Thanks for the patch! |
…float-no-register [pycaffe] fix boost 1.60 compatibility issue; close #3494
| .def("_set_input_arrays", &Net_SetInputArrays, | ||
| bp::with_custodian_and_ward<1, 2, bp::with_custodian_and_ward<1, 3> >()) | ||
| .def("save", &Net_Save); | ||
| bp::register_ptr_to_python<shared_ptr<Net<Dtype> > >(); |
There was a problem hiding this comment.
@longjon can you comment on this? It seems redundant to me given the bp::class_ declarations but boost 1.60 complains without it (on OS X at least).
|
Note that this can cause harmless warnings for some boost versions. These are the warnings: This happens for me at least with boost 1.59 on Ubuntu 14.04. This should maybe be conditioned on boost version/platform as gross as adding guards is. See #3866 for one attempt. |
…lob-float-no-register [pycaffe] fix boost 1.60 compatibility issue; close BVLC#3494
fixbug #3494 , register shared_ptr Blob Dtype