Giter VIP home page Giter VIP logo

Comments (6)

longjon avatar longjon commented on April 27, 2024

The new pycaffe updates require numpy >= 1.7 (which was added to Ubuntu in 13.04). If upgrading numpy (or using Anaconda etc.) is not an option, I believe the following patch should work around the issue, although I don't have a build environment I can use to test it right now.

diff --git a/python/caffe/pycaffe.cpp b/python/caffe/pycaffe.cpp
index 2bfae9e..59424ce 100644
--- a/python/caffe/pycaffe.cpp
+++ b/python/caffe/pycaffe.cpp
@@ -13,6 +13,7 @@
 // Temporary solution for numpy < 1.7 versions: old macro.
 #ifndef NPY_ARRAY_C_CONTIGUOUS
 #define NPY_ARRAY_C_CONTIGUOUS NPY_C_CONTIGUOUS
+#define PyArray_SetBaseObject(arr, x) (PyArray_BASE(arr) = (x))
 #endif

from caffe.

middlecode avatar middlecode commented on April 27, 2024

thanks man 👍

from caffe.

simmers avatar simmers commented on April 27, 2024

Sorry for making a dupe (#50)...haven't done much github and didn't see the full list of issues.

It turned out that my numpy version was pre 1.7 so I upgraded to 1.8.0 and did a clean build and tried 'make pycaffe' again but got the exact same errors.

from caffe.

shelhamer avatar shelhamer commented on April 27, 2024

Are you sure it isn't still including the header files of an older, less than 1.7, version of numpy? Please check your Makefile.config to see that the numpy 1.8.0 headers are included.

A common case is accidentally including an older, system, numpy over a recent, local, numpy (such as anaconda).

from caffe.

SophieZhou avatar SophieZhou commented on April 27, 2024

@longjon Thanks

from caffe.

bittnt avatar bittnt commented on April 27, 2024

@middlecode I think the main problem you might have is because you install numpy through "sudo apt-get install python-numpy" rather than through "sudo pip install numpy". Notice that if you do both, you would probably get the same errors. So make sure you run "sudo apt-get remove python-numpy" and also you run "sudo pip install numpy" as the readme suggested.

BTW, anyone has a suggestions on the alternative for apt-get? It seems apt-get is bad and it always get the outofdate libraries. Although this question is out of interest. :)

from caffe.

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.