GithubHelp home page GithubHelp logo

Comments (6)

darioizzo avatar darioizzo commented on July 17, 2024

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.

darioizzo avatar darioizzo commented on July 17, 2024

Originally posted by darioizzo on 2012-08-29 18:12:17.

  • status: open --> accepted
  • assigned_to: Dario Izzo

from pagmo.

darioizzo avatar darioizzo commented on July 17, 2024

Originally posted by darioizzo on 2012-10-22 17:23:53.

  • status: accepted --> closed

from pagmo.

darioizzo avatar darioizzo commented on July 17, 2024

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.

AmandaYingYiWu24 avatar AmandaYingYiWu24 commented on July 17, 2024
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.

darioizzo avatar darioizzo commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.