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

Use generator scripts to automatically create Python bindings #1267

Closed
kloudkl opened this issue Oct 13, 2014 · 5 comments
Closed

Use generator scripts to automatically create Python bindings #1267

kloudkl opened this issue Oct 13, 2014 · 5 comments

Comments

@kloudkl
Copy link
Contributor

kloudkl commented Oct 13, 2014

As more and more interfaces are exposed in Python manually, it is not only hard to keep the Python and C++ API in sync but also introduce bugs and performance issues on the Python side. It would be nice to be able to automatically generate the Python scripts. OpenCV does this in a clear and clean way.

@kloudkl kloudkl changed the title Use generator scripts to automatically create python bindings Use generator scripts to automatically create Python bindings Oct 13, 2014
@shelhamer
Copy link
Member

I actually take issue with this. The C++ interface is not a naturally Pythonic interface in and of itself and I like the control of developing our own interface and exporting well-formed classes instead of bare functions. @longjon, agreed?

@jeffdonahue
Copy link
Contributor

I'm not @longjon, but I do agree. The interfaces really just need a few unit tests; I think those would go a long way to improve maintainability. (Even just a Python script that Travis can run that does import caffe would be a pretty useful start -- we currently don't even have a way of automatically checking that changes to the wrapper modules are syntactically valid, which indeed makes maintenance and reviewing changes a painfully manual process IMO.)

@longjon
Copy link
Contributor

longjon commented Oct 15, 2014

I am @longjon, and I agree with most everything said in this thread. There is a certain amount of boilerplate involved in the Python interface, and it's a good idea to keep in mind the tools that might help alleviate that. That said, the bindings do enough extra magic that it's hard to imagine automatically generating very much of the existing code, and the bindings are sufficiently few that the overhead of generation would certainly exceed the current overhead of maintenance. (Also, there have been no performance issues with the bindings proper, only with pure Python code.)

And yes, testing the Python interface is the real pressing issue. Hopefully the next merge to pycaffe will be for testing, even if it is just an import or just runs the basic interface.

@futurely
Copy link

Unit test frameworks are inherent parts of Python and MATLAB.

@futurely
Copy link

Add unit test for the Python and MATLAB wrappers is not a novel issue. #173 has been open for a long time.

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

5 participants