Comments (6)
Originally posted by darioizzo on 2012-08-27 13:11:37.
This has to do with a strange behaviour that in some system is showed by the boost::python query register. The following code:
boost::python::type_info info = boost::python::type_id();
const boost::python::converter::registration* reg = boost::python::converter::registry::query(info);
fails if one tries to register both std::vector and std::vectorstd::vector in the same boost::python module
from pagmo.
Originally posted by darioizzo on 2012-08-29 18:12:17.
- status: open --> accepted
- assigned_to: Dario Izzo
from pagmo.
Originally posted by darioizzo on 2012-10-22 17:23:53.
- status: accepted --> closed
from pagmo.
Originally posted by darioizzo on 2012-10-22 17:23:53.
I think this is a bug in boost python. In some operating systems the default constructor is called for an object registration even when the relative type conversion has not been registered. This makes the call to query return the wrong result. As a workaround, I propose to check, in case an already registered converter is found, that the found registartion makes sense having a non NULL pointer to a to-python converter (NULL is assigned by the default constructor of the registration object).
The code below has been produced and commited in core.cpp to fix the problem
#define REGISTER_CONVERTER(T,policy) \
{\
boost::python::type_info info = boost::python::type_id<T >(); \
const boost::python::converter::registration* reg = boost::python::converter::registry::query(info); \
if (reg == NULL) \
{\
to_tuple_mapping<T >();\
from_python_sequence<T,policy>();\
}\
else if ((*reg).m_to_python == NULL)\
{\
to_tuple_mapping<T >();\
from_python_sequence<T,policy>();\
}\
}
from pagmo.
I open IPython to test that PyCaffe is working. I input "ipython" command, and enter into the ipython page. Then, I input the command "import caffe", but I got below warnings:
/root/code/caffe-master/python/caffe/pycaffe.py:13: RuntimeWarning: to-Python converter for boost::shared_ptrcaffe::Net already registered; second conversion method ignored.
from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, \
/root/code/caffe-master/python/caffe/pycaffe.py:13: RuntimeWarning: to-Python converter for boost::shared_ptrcaffe::Blob already registered; second conversion method ignored.
from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, \
/root/code/caffe-master/python/caffe/pycaffe.py:13: RuntimeWarning: to-Python converter for boost::shared_ptrcaffe::Solver already registered; second conversion method ignored.
from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, \
Would you pls help to give me some suggestions to resolve it?
from pagmo.
This is not an issue with pagmo, maybe you may want to bring it to the attention of the pycaffe developers.
from pagmo.
Related Issues (20)
- Linking issue HOT 10
- Is it possible to set the initial values for variable? HOT 3
- Support for general PAGMO2 installation HOT 1
- how to choose a binary chromomse encoding while creating a new problem ?
- Missing pygmo.problem & pygmo_plugins_nonfree issue HOT 2
- Compiling getting_started.cpp takes 1 minutes HOT 3
- Dominance checking when working with multiple objective functions HOT 2
- Multi objective Problems with Non Linear Constraints HOT 1
- AttributeError: module 'pygmo' has no attribute 'problem' HOT 2
- terminate called after throwing an instance of 'std::invalid_argument' what: function: best_idx HOT 3
- Please do not install Eigen headers, it is available on all systems HOT 2
- Question: Why are you not exposing DIRECT from the NLOpt library?
- Question: Which method to use for hypervolume calculations HOT 1
- gaco not in Pygmo HOT 1
- type object 'algorithm' has no attribute 'nspso' HOT 3
- GPGPU optimization problem with archipelago HOT 1
- C Wrapper for PAGMO HOT 2
- What happened to the pygmo 2.x documentation? HOT 1
- Line No. 554, /pagmo_plugins_nonfree/src/snopt7.cpp
- Upload pygmo source to PyPI as well as Python 3.9 and 3.10 wheels HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pagmo.