Digits installation conflicts with existing Caffe installation using OpenCV 3

181 views
Skip to first unread message

Josh

unread,
Dec 6, 2015, 9:14:33 PM12/6/15
to DIGITS Users
I have installed Digits on Ubuntu 14.04 using the provided installation script and then followed the Getting Started guide, which I was able to complete successfully.

However, prior to installing Digits, I had a separate Caffe installation that was built using OpenCV 3. I require Caffe with OpenCV 3 for particular projects external to the Digits framework.

The Digits installation script appears to have installed OpenCV 2.4 on top of OpenCV 3, which is now causing conflicts with my OpenCV 3 installation. Now I am unable to compile C++ code that makes use of the separate (i.e. non-Digits) Caffe installation due to this conflict.

How do I best resolve this version conflict while enabling both (my original) Caffe installation and Digits to work side-by-side?

Luke Yeager

unread,
Dec 7, 2015, 4:09:18 PM12/7/15
to DIGITS Users
When you say "the provided installation script" are you talking about the web installer? I'll assume yes.

You need the package libopencv-dev to build Caffe. But you only need libopencv-highgui2.4, libopencv-imgproc2.4 and libopencv-core2.4  to run caffe once it's built already. Try this:

apt-get remove libopencv-dev
apt
-get autoremove
apt
-get install libopencv-highgui2.4 libopencv-imgproc2.4 libopencv-core2.4

Then you should still be able to run the version of Caffe that comes with the web installer, while picking up the header files for OpenCV 3, like you want.

Josh

unread,
Dec 7, 2015, 8:26:17 PM12/7/15
to DIGITS Users
Thanks for the reply Luke.


On Tuesday, December 8, 2015 at 7:39:18 AM UTC+10:30, Luke Yeager wrote:
When you say "the provided installation script" are you talking about the web installer? I'll assume yes.


Yes.
 
You need the package libopencv-dev to build Caffe. But you only need libopencv-highgui2.4, libopencv-imgproc2.4 and libopencv-core2.4  to run caffe once it's built already. Try this:

apt-get remove libopencv-dev
apt
-get autoremove
apt
-get install libopencv-highgui2.4 libopencv-imgproc2.4 libopencv-core2.4

Then you should still be able to run the version of Caffe that comes with the web installer, while picking up the header files for OpenCV 3, like you want.


I removed OpenCV 2.4 in a similar fashion to what you described above ("apt-get remove" followed by "autoremove"), and although this seems to have resolved the conflict relating to my original (non-DIGITS) Caffe installation, I am having problems reading png image files, which previously was no problem within OpenCV 3.

I originally built OpenCV 3 using the following cmake command:

cmake -D BUILD_TIFF=ON -D WITH_CUDA=ON -D CUDA_ARCH_BIN=5.2 -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PNG=OFF -D CMAKE_BUILD_TYPE=RELEASE ..

This prevents OpenCV from building with its own version of libpng (insteading opting for the "system-wide version" of libpng), which has caused me version problems in the past when reading png images.

It appears that DIGITS installation of OpenCV 2.4 is still having an effect with respect to reading png files.

Since removing OpenCV 2.4 and encountering this problem, I uninstalled OpenCV 3 (simply: make uninstall) and then reinstalled it (make clean then make install), however the problem persists. I am confused as to why this is the case.

Luke Yeager

unread,
Dec 7, 2015, 8:34:41 PM12/7/15
to DIGITS Users
Hi Josh,

Sorry, I'm not much of an OpenCV buff. You might want to look around in the Caffe user group? https://groups.google.com/d/forum/caffe-users

Sean Huver

unread,
Feb 14, 2016, 12:39:15 PM2/14/16
to DIGITS Users
Just wanted to say I had a very similar issue with OpenCV3.0 conflicting with the 2.4 version required by caffe-nv. 

It wasn't until I explicitly removed libopencv-highgui2.4 libopencv-imgproc2.4 libopencv-core2.4, 

and then reinstalled them as per Luke's suggestion that my troubles went away and Digits is back to running.

Thanks Luke!
Reply all
Reply to author
Forward
0 new messages