BVLC / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
34.07k stars 18.7k forks source link

ImportError: /lib/x86_64-linux-gnu/librsvg-2.so.2: undefined symbol: cairo_tag_end #6805

Open TWMazza opened 5 years ago

TWMazza commented 5 years ago

Issue summary

After many failed attempts and messed up Linux installations I've successfully compiled Caffe, Protobuf and DeepDream, just to face an error when running the deepdreaming.py script for the first time. I'm not sure if the Caffe Git is the right place to post this report to, although it looks like an error during import of Caffe - my sincere apologies if I failed to pick the correct Git.

python deepdreaming.py --help and other parameters result in the below error message:

python deepdreaming.py --help Traceback (most recent call last): File "deepdreaming.py", line 13, in import caffe File "/home/twmlive/deepdream/caffe/python/caffe/init.py", line 1, in from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer File "/home/twmlive/deepdream/caffe/python/caffe/pycaffe.py", line 13, in from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, \ ImportError: /lib/x86_64-linux-gnu/librsvg-2.so.2: undefined symbol: cairo_tag_end

Steps to reproduce

Steps before steps to reproduce

To be able to run DeepDream with as little interference as possible, I've installed Debian 10 latest from a netinstall USB drive with Debian Desktop Environment, GNOME, MATE and the standard system utilities (in previous attempts I installed MATE only rather than MATE and GNOME and faced the similar issues). After installing and setting up the system with some basic tools (like Timeshift, gparted, gdebi, Handbrake, libdvd-pkg, ffmpeg, Chrome and Opera, ...), I've been following a brief set of instructions found on Knight-of-pi.org to set up DeepDream. Though I had to make a few adjustments that may or may not be related to this:

There was a lot of troubleshooting going on yesterday, so I may have missed one or two details. It was only the compilation process for pycaffe being so difficult, after that everything else worked quite well with barely any trouble. Also, this is probably the 50th attempt (not kidding, since once I mess up I cannot fix it and gotta start over again) in setting up a clean Debian (or other Linux distros) for DeepDream and DeepDreamVideo.

Tried solutions

I've also tried to downgrade librsvg2-2 since I read a post about this error popping up a year ago related to some other application on Linux. But I gave up this idea since, according to the forum thread, they figured out it was only happening with a certain version of librsvg and in few environments only, so likely it has nothing to do with the lib but with the environment instead. Anyways, none of the installed packages had an impact on the problem, the error message did not change.

System configuration

Issue checklist

anoob09 commented 5 years ago

Did you fix it? I am getting same error.

EdwarDu commented 4 years ago

Come across this when building opencv. For me it turns out to be mismatching librsvg and libcairo when import in python environment. One walkaround is to use ldd to find the matching libcairo and then LD_PRELOAD to force using the matching libcairo.

OR find which wrong libcairo is loaded (for me is the ones installed in anaconda folder), move them or rename them.

dchx commented 2 years ago

I'm using anaconda3-5.2.0 and I got the same error when installing PyAV. Inspired by @EdwarDu, I fixed this by upgrading cairo to 1.16.0:

conda install -c anaconda cairo==1.16.0