Package Details: caffe 1.0-18

Git Clone URL: https://aur.archlinux.org/caffe.git (read-only, click to copy)
Package Base: caffe
Description: A deep learning framework made with expression, speed, and modularity in mind (cpu only)
Upstream URL: https://caffe.berkeleyvision.org/
Keywords: ai artificial cuda intelligence nvidia
Licenses: BSD
Conflicts: caffe-cpu
Provides: caffe-cpu
Replaces: caffe-cpu
Submitter: yiuin
Maintainer: dbermond
Last Packager: dbermond
Votes: 18
Popularity: 0.000000
First Submitted: 2015-10-17 05:31 (UTC)
Last Updated: 2022-03-01 14:24 (UTC)

Latest Comments

dbermond commented on 2022-03-01 14:12 (UTC)

@henkm Fixed.

henkm commented on 2022-02-28 15:09 (UTC) (edited on 2022-02-28 15:14 (UTC) by henkm)

Trying to build in a clean chroot but running into this error:

src/caffe/util/io.cpp: In function ‘bool caffe::ReadProtoFromBinaryFile(const char*, google::protobuf::Message*)’:
src/caffe/util/io.cpp:57:34: error: no matching function for call to  ‘google::protobuf::io::CodedInputStream::SetTotalBytesLimit(const int&, int)’
   57 |   coded_input->SetTotalBytesLimit(kProtoReadBytesLimit, 536870912);
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/caffe/util/io.cpp:2: 
/usr/include/google/protobuf/io/coded_stream.h:406:8: note: candidate: ‘void  google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int)’
  406 |   void SetTotalBytesLimit(int total_bytes_limit);
      |        ^~~~~~~~~~~~~~~~~~
/usr/include/google/protobuf/io/coded_stream.h:406:8: note:   candidate expects 1 argument, 2 provided
make: *** [Makefile:604: .build_release/src/caffe/util/io.o] Error 1

The exact same error occurs in caffe-git.

ptrstn commented on 2020-06-23 18:25 (UTC)

@dbermond thanks, it is indeed working again after rebuilding the package.

I used the caffe-git package for this job.

dbermond commented on 2020-06-23 17:58 (UTC)

ptrstn libprotobuf.so.22 is no longer on the repositories. You need to rebuild the package against the current protobuf package for linking to the current profobuf library sover.

ptrstn commented on 2020-06-23 17:55 (UTC)

I'm getting the following error message when importing caffe

>>> import caffe
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.8/site-packages/caffe/__init__.py", line 1, in <module>
    from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer
  File "/usr/lib/python3.8/site-packages/caffe/pycaffe.py", line 13, in <module>
    from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, \
ImportError: libprotobuf.so.22: cannot open shared object file: No such file or directory

I have no idea what happened. It worked a few months ago.

dbermond commented on 2020-05-01 18:58 (UTC)

@jpeter Package is building fine, and also caffe-git. The search path for 'pyconfig.h' header is specified in Makefile.config by the PYTHON_INCLUDE variable.

jpeter commented on 2020-04-29 10:21 (UTC)

caffe, caffe-git don't compile:

In file included from /usr/include/boost/python/detail/prefix.hpp:13, from /usr/include/boost/python/args.hpp:8, from /usr/include/boost/python.hpp:11, from src/caffe/layer_factory.cpp:4: /usr/include/boost/python/detail/wrap_python.hpp:57:11: fatal error: pyconfig.h: No such file or directory 57 | # include <pyconfig.h> | ^~~~~~~~~~~~ compilation terminated.

dbermond commented on 2019-11-20 23:43 (UTC)

@petronny Package updated for python 3.8.

petronny commented on 2019-11-20 06:09 (UTC)

I get trouble when building against python 3.8.

CXX src/caffe/internal_thread.cpp
CXX src/caffe/layer_factory.cpp
In file included from /usr/include/boost/python/detail/prefix.hpp:13,
                 from /usr/include/boost/python/args.hpp:8,
                 from /usr/include/boost/python.hpp:11,
                 from src/caffe/layer_factory.cpp:4:
/usr/include/boost/python/detail/wrap_python.hpp:57:11: fatal error: pyconfig.h: No such file or directory
   57 | # include <pyconfig.h>
      |           ^~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:593: .build_release/src/caffe/layer_factory.o] Error 1
make: *** Waiting for unfinished jobs....

dbermond commented on 2019-05-18 20:18 (UTC)

@petronny Thank you for pointing this, and sorry for the late answer. Package updated.

petronny commented on 2019-03-04 07:31 (UTC)

Please add texlive-latexextra to makedepends.
Or LaTeX will raise LaTeX Error: Filenewunicodechar.sty' not found`.

Please also check the other caffe* packages.

bertptrs commented on 2018-10-18 11:42 (UTC)

Rebuilds of the package are broken, since halfway through it attempts to link to itself, and the installed version has priority over the recently compiled one, and if the installed version has linking errors (e.g. boost or something else was updated) you won't be able to build.

A workaround is to delete /usr/lib/libcaffe.so.1.0.0 before building this package.

dbermond commented on 2018-10-05 15:57 (UTC)

@hl037 Yes, just uninstall any caffe package before building.

hl037 commented on 2018-10-05 07:55 (UTC) (edited on 2018-10-05 09:35 (UTC) by hl037)

EDIT : Do not forget to remove caffe-cpu before building this package, else the libcaffe.so used could be the one previously installed, and that breaks the build

PREVIOUS MESSAGE :

Hello, I am having this error when building (certainly a makeflie / configuration problem as Boost is version .68 now)

/usr/bin/ld: warning: libprotobuf.so.16, needed by /usr/lib/libcaffe.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libboost_system.so.1.67.0, needed by /usr/lib/libcaffe.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libhdf5.so.101, needed by /usr/lib/libcaffe.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libboost_thread.so.1.67.0, needed by /usr/lib/libcaffe.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libboost_python37.so.1.67.0, needed by /usr/lib/libcaffe.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /usr/lib/libcaffe.so: undefined reference to `boost::system::generic_category()'
/usr/bin/ld: /usr/lib/libcaffe.so: undefined reference to `google::protobuf::internal::OnShutdownDestroyMessage(void const*)'
/usr/bin/ld: /usr/lib/libcaffe.so: undefined reference to `google::protobuf::internal::OnShutdownDestroyString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*)'

dbermond commented on 2018-08-22 18:26 (UTC)

@Ape The caffe packages have changed the naming schema. I have filled a merge request for this package.

Please use caffe for the cpu-only build or caffe-cuda for the cuda-enabled build. All are working fine.

dbermond commented on 2018-08-22 18:19 (UTC)

Important notice:

This package now provides the non-cuda version (as known as the 'cpu only' build).

If you want caffe with cuda support, use package caffe-cuda. This new package naming schema will better reflect the package contents. This conforms to tensorflow package naming from the official repositories.

Ape commented on 2018-08-22 12:45 (UTC) (edited on 2018-08-22 12:45 (UTC) by Ape)

Fails to build:

In file included from /usr/include/boost/python/detail/prefix.hpp:13,
                 from /usr/include/boost/python/args.hpp:8,
                 from /usr/include/boost/python.hpp:11,
                 from src/caffe/layer_factory.cpp:4:
/usr/include/boost/python/detail/wrap_python.hpp:50:11: fatal error: pyconfig.h: No such file or directory
 # include <pyconfig.h>

dbermond commented on 2018-06-11 01:11 (UTC)

@Alf2010 I see. I also have a lot of AUR packages installed, but they don't give any problem with caffe. A final word that I can say is: try to build each AUR dependency also in a clean chroot before passing them with -- -I in extra-x86_64-build. I cannot say too much, since everything is working fine here, and it was already confirmed to build fine in a chroot by another user. Thank you for appreciating this package and nccl.

Alf2010 commented on 2018-06-10 15:02 (UTC)

I tried to build it in a clean chroot with the help of the wiki page but it fails ([Makefile:626: .build_release/tools/net_speed_benchmark.bin] Error 1). Currently I can't take more time to investigate, I will see it later. I don't know what can be wrong with my system, I am using a lot of aur packages and everything is ok except for caffe. Thank's again for your help and for making this package and the others like nccl.

dbermond commented on 2018-06-08 19:01 (UTC)

@Alf2010 Something should be also wrong in your building tree or system. You need to find what's going on in order to be able to build in a normal environment. Building in a clean chroot assures that everything is fine, eliminating all the interferences.

Alf2010 commented on 2018-06-07 15:32 (UTC)

Hi all, Same error message than Michael with libcudart.so.9.0 I didn't try yet to build it in a clean chroot

dbermond commented on 2018-06-05 15:20 (UTC)

@MichaelChou Good to know that you solved the issue. Thank you for the feedback.

MichaelChou commented on 2018-06-04 06:41 (UTC)

@dbermond Thanks for your informative reply. I succeeded building it in a clean chroot.

I dug around a bit and figured out the cause of this issue. I put it here in case it happen to anyone else:

Caffe indirectly depends on ffmpeg. If you manually built ffmpeg against previous version of cuda, you will have this issue. A simple rebuild of ffmpeg (after upgrading cuda of course) will solve it.

dbermond commented on 2018-06-03 02:04 (UTC)

@MichaelChou I cannot reproduce your issue. Package is building fine for me in a normal working environment as like as in a chroot environment.

Since you're getting an error about a library from cuda 9.1, it smells like a problem in your building tree or even on your system. It should not complain about something from a previous cuda version.

Make sure that you're using a new and clean directory for building (or use makepkg -C/--cleanbuild option). If it still does not work, build in a clean chroot and it should do the job.

MichaelChou commented on 2018-06-02 14:15 (UTC) (edited on 2018-06-02 14:16 (UTC) by MichaelChou)

I failed building with error output like this:

...
/usr/bin/ld: warning: libcurand.so.9.1, needed by /usr/lib/libcaffe.so, not found (try using -rpath or -rpath-link)
...
/usr/lib/libcaffe.so: undefined reference to `cudaGetDeviceCount@libcudart.so.9.1'
...
make: *** [Makefile:626: .build_release/tools/test_net.bin] Error 1
...

I already have cuda 9.2 installed.

dbermond commented on 2018-03-08 16:31 (UTC)

@nhkrishna This is normal and expected. If you take a look at the PKGBUILD file, you'll see that the supported architecture (the 'arch' array) is x86_64 only. This is because the AUR is in general for the x86_64 architecture, and at most for the i686 architecture. ARM is in general not supported here. ARM can be supported for a specific package if the package maintainer is willing to support it. But I, as the current caffe package maintainer, cannot support ARM architectures.

If you wish to install caffe on ARM, you should use the proper Arch Linux ARM support channels, like their forum.

nhkrishna commented on 2018-03-08 12:44 (UTC)

I'm trying to install caffe on archlinux. I'm using armv7h architecture. But its showing error like "caffe is not available for armv7h architecture". I've tried following steps. 1)git clone https://aur.archlinux.org/caffe.git 2)cd caffe 3)makepkg PKGBUILD I got the error as below ==> ERROR: caffe is not available for the 'armv7h' architecture.

==> ERROR: An unknown error has occurred. Exiting...

dbermond commented on 2018-02-20 14:47 (UTC)

@gamer01 Caffe have official support for nvidia gpus only. There are custom caffe distributions designed for intel and opencl, but as far as I can tell, these are not official ones. This package needs cuda because the binaries links to cuda libraries. cudnn is enabled in the build, so it's also needed for the same reason.

gamer01 commented on 2018-02-20 14:14 (UTC)

Is cudnn and cuda really a strict dependency? I mean you can run caffe also without a Nvidea card in your device, right?

dbermond commented on 2017-12-22 23:38 (UTC)

@t4mmi Hi. Package is building fine for me. There are no dependency conflicts for me. Please try to build in a chroot.

t4mmi commented on 2017-12-22 10:16 (UTC)

Hi all, I got a conflict between dependencies as openblas-lapack wont install along with blas and lapack that are required for numpy and opencv ...

dbermond commented on 2017-07-31 16:07 (UTC)

@znmeb To install it system wide, you need firstly to create a local package. For this you need to create a PKGBUILD (a script that automates the building and creation of packages with makepkg). After the local package creation, you can install it system wide with the pacman package manager. You can read information about this on the following Wiki pages: https://wiki.archlinux.org/index.php/Creating_packages https://wiki.archlinux.org/index.php/PKGBUILD https://wiki.archlinux.org/index.php/Makepkg If you wish to share your results with the community and if you have the skills (and time) to do package maintenance, you can create an AUR package. You can read about the AUR on this Wiki page: https://wiki.archlinux.org/index.php/Arch_User_Repository At the same AUR Wiki page you can see the steps needed to create and submit AUR packages: https://wiki.archlinux.org/index.php/Arch_User_Repository#Sharing_and_maintaining_packages I think this is not the appropriate channel to help you in using these tools. For further help you should ask in the Arch Linux forums.

znmeb commented on 2017-07-29 22:41 (UTC) (edited on 2017-07-29 22:45 (UTC) by znmeb)

I have it working - it took a bit of doing and I'm still not sure how to make a PKGBUILD. The steps required are: 1. Install the "amdgpu" kernel module and make sure it's loaded first. 2. Install "opencl-amd". The open source OpenCL libraries don't work, and the AUR amdgpu-pro doesn't install. I'll have to troubleshoot the latter; this should work if amdgpu-pro installs. 3. Clone the GitHub repo https://github.com/BVLC/caffe.git and check out the "opencl" branch. 4. "make" and "make test". 5. "make runtest". This takes a long time, so you probably wouldn't do it in a package. On my card (peak 1800 GFLOPS) it runs 2600 seconds! Now you have a local "caffe". I haven't figured out how to install it globally yet. Note that this is only useful with an AMD GPU - for NVidia the "caffe" in AUR should work and for Intel there are other ways to build "caffe". I don't have a new-enough Intel GPU to try this. There's probably a repo out there; a lot of Intel folks are working on deep learning and posting open source tools. Once I get some free time again I'm going to try modifying the "caffe" PKGBUILD to do all this (except the kernel part). I may have missed some dependencies in the process since I had "caffe-cpu" installed.

dbermond commented on 2017-07-27 01:24 (UTC)

@znmeb Welcome to the Arch Linux community. If you manage to get it working you should create a PKGBUILD in order to produce a package for your personal use. This will automate your build/install process and integrate the software into the pacman package manager. If you want to share with the community you can create an AUR package but this would need knowledge about package maintenance.

znmeb commented on 2017-07-25 08:33 (UTC)

I have an AMD "Bonaire" GPU. It looks like there's some upstream support for running caffe on AMD (and Intel) GPUs using OpenCL (https://github.com/BVLC/caffe/tree/opencl). I'm testing this now building from the GitHub repo - if I can make it work and use the GPU I'll post the setup here. I'm new to Arch; not sure how it should be packaged if it works.

dbermond commented on 2017-07-21 02:34 (UTC)

@kwe Thank you for the report. This should be fixed as of version 1.0-4.

kwe commented on 2017-07-21 00:09 (UTC)

Fails to build with -fno-plt specified in makepkg.conf See https://bugs.archlinux.org/task/54855

dbermond commented on 2017-05-24 19:23 (UTC)

@marcs The package is building fine for me. Tested in two different machines. Also tested in a clean chroot on both machines. Caffe can be a bit tricky to build in certain circumstances. To ensure good building results please do these steps: 1) uninstall any caffe package before you start to compile; 2) use makepkg -C (--cleanbuild) option (or delete the 'src' directory before running makepkg). If it still fails, build it in a clean chroot using extra-x86_64-build (from devtools, see the Wiki).

marcs commented on 2017-05-24 16:34 (UTC)

I have a build error: https://pastebin.com/94UDip7y

dbermond commented on 2017-04-08 13:04 (UTC)

@g3n35i5 I understand. Unfortunately I cannot help you to achieve matlab support. But I suggest you to try caffe-git because currently it has more features and brings fixes that are not present in the release version.

g3n35i5 commented on 2017-04-04 08:25 (UTC)

@Bermond Thank you for your quick reply. I just asked, because I had trouble building the matcaffe respectively using it in matlab, due to outdated libraries in mex. So my first thought was that I missed something in the installation process. Does anyone have experience in building and using matcaffe on archlinux?

dbermond commented on 2017-04-01 16:01 (UTC)

@g3n35i5 Yes, I've seen this. But I don't think that it's a good idea beucase: 1) matlab is a commercial product and not everyone can have it. It would break package building for those who don't have it, which would not be a small number of people. 2) matlab packages cannot be build directly or with AUR helpers, but it requires manual download and intervention. So adding matlab dependency would also break AUR helpers usability for caffe.

g3n35i5 commented on 2017-03-30 15:24 (UTC)

Have you thought about adding matcaffe to the PKGBUILD?

yiuin commented on 2016-08-11 17:25 (UTC) (edited on 2016-08-11 17:37 (UTC) by yiuin)

Sorry all, I clearly haven't been looking at this regularly. For Cuda I think a separate package might be needed, if its going to have to compile with a different compilers. PKGBUILD isn't really setup for options like that. So I looked at https://aur.archlinux.org/packages/caffe-cpu-git/ and I think I'm going to disown this package so that that package can be the main caffe one. I haven't done a good job at maintaining this. Maybe at some point I'll make a matching caffe-gpu-git.

yiuin commented on 2016-08-11 17:15 (UTC)

Ahh Kamahl! I'll add it.

jachymb commented on 2016-08-11 13:22 (UTC)

I needed hdf5-cpp-fortran, without it, I got: CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: HDF5_hdf5_cpp_LIBRARY linked by target "caffe" in directory /tmp/yaourt-tmp-jachym/aur-caffe/src/caffe-rc3/src/caffe -- Configuring incomplete, errors occurred!

matthieu637 commented on 2016-06-30 10:01 (UTC) (edited on 2016-06-30 10:06 (UTC) by matthieu637)

For CUDA : I cannot compile it with gcc version 6 (currently used by arch). I had to use gcc5 and add -DCMAKE_C_COMPILER=gcc-5 for cuda (while CXX compiler can be leave to gcc6).

acgtyrant commented on 2016-06-07 05:39 (UTC)

I think you can add cuDNN as the optional dependence.

agarie commented on 2016-05-27 03:55 (UTC)

You probably should move the python/caffe/ directory to /usr/lib/python2.7/site-packages/caffe instead of leaving it on /usr/python. This way it'll be available for use right after installing your package!

deltaecho commented on 2016-02-26 11:33 (UTC)

How to fix errors like, "No to_python (by-value) converter found for C++ type: boost::shared_ptr<caffe::Blob<float> >": https://github.com/BVLC/caffe/issues/3494#issuecomment-183874700 Example patch fixing two such errors follows: --- ./python/caffe/_caffe.cpp.orig 2016-02-26 03:21:25.253857064 -0800 +++ ./python/caffe/_caffe.cpp 2016-02-26 03:22:13.420836642 -0800 @@ -256,6 +256,11 @@ bp::with_custodian_and_ward<1, 2, bp::with_custodian_and_ward<1, 3> >()) .def("save", &Net_Save); + // Fix for caffe pythonwrapper for boost 1.6 + boost::python::register_ptr_to_python<boost::shared_ptr<Blob<Dtype> > >(); + boost::python::register_ptr_to_python<boost::shared_ptr<caffe::Net<float> > >(); + // End fix + bp::class_<Blob<Dtype>, shared_ptr<Blob<Dtype> >, boost::noncopyable>( "Blob", bp::no_init) .add_property("shape",

yiuin commented on 2015-10-30 00:33 (UTC)

Thanks guys. Updated for 32bit compatibility and added cmake.

waratuman commented on 2015-10-29 22:16 (UTC)

Just tried to install the package and cmake wasn't listed as a dependency.

davidmcinnis commented on 2015-10-19 04:18 (UTC)

could you please make these modifications in the PKGBUILD so it builds on i686 machines? --- a/PKGBUILD +++ b/PKGBUILD @@ -16,12 +16,18 @@ source=("https://github.com/BVLC/$pkgname/archive/$pkgver.tar.gz") sha256sums=('55c9c20870b30ce398e19e4f1a62ade1eff08fce51e28fa5604035b711978eec') build() { + if [ $CARCH = "i686" ]; then + lib="lib" + else + lib="lib64" + fi + cd "$srcdir/$pkgname-$pkgver" rm -fr build mkdir build cd build - cmake ../ -DAtlas_LAPACK_LIBRARY=/usr/lib64/libatlas.so \ - -DAtlas_BLAS_LIBRARY=/usr/lib64/libatlas.so \ + cmake ../ -DAtlas_LAPACK_LIBRARY="/usr/"$lib"/libatlas.so" \ + -DAtlas_BLAS_LIBRARY="/usr/"$lib"/libatlas.so" \ -DCMAKE_INSTALL_PREFIX=$pkgdir/usr/ make