无法为 Caffe 安装 "Boost" 先决条件
Can't install the "Boost" prerequisite for Caffe
我正在学习机器学习,最近我遇到了这个:Wide-Area Image Geolocalization with Aerial Reference Imagery
。
这是一个仅根据图像预测图像 GPS 位置的网络。不用说,我很兴奋,只是发现其中一个要求:
import glob
import caffe
import numpy as np
import multiprocessing
import matplotlib.pyplot as plt
from collections import defaultdict
是 Caffe,我似乎无法安装,因为我无法安装主要先决条件:Boost
我第一次尝试运行标准sudo apt-get install libboost-all-dev
,不仅失败了:
The following packages have unmet dependencies:
libboost-all-dev : Depends: libboost-chrono-dev but it is not going to be installed
Depends: libboost-date-time-dev but it is not going to be installed
Depends: libboost-filesystem-dev but it is not going to be installed
Depends: libboost-graph-dev but it is not going to be installed
Depends: libboost-graph-parallel-dev but it is not going to be installed
Depends: libboost-iostreams-dev but it is not going to be installed
Depends: libboost-log-dev but it is not going to be installed
Depends: libboost-mpi-dev but it is not going to be installed
Depends: libboost-mpi-python-dev but it is not going to be installed
Depends: libboost-program-options-dev but it is not going to be installed
Depends: libboost-python-dev but it is not going to be installed
Depends: libboost-regex-dev but it is not going to be installed
Depends: libboost-serialization-dev but it is not going to be installed
Depends: libboost-system-dev but it is not going to be installed
Depends: libboost-thread-dev but it is not going to be installed
Depends: libboost-wave-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
它给了我一个 "but it is not going to be installed" 错误。然后我尝试从源安装:
wget -O boost_1_55_0.tar.gz http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz/download
tar xzvf boost_1_55_0.tar.gz
cd boost_1_55_0/
./bootstrap.sh --prefix=/usr/local
./b2
这很快就让我的整个终端充满了 g++ 错误。然后我尝试从头开始:
sudo apt-get --purge remove libboost-all-dev libboost-dev libboost-doc
sudo apt-get install -f
sudo dpkg --configure -a
sudo apt-get clean
sudo apt-get update
sudo apt-get install libboost1.54-dev
虽然与测试脚本一起工作:How to Install boost on Ubuntu?
当我尝试 make
咖啡时,我得到了这个:
CXX src/caffe/util/db.cpp
In file included from ./include/caffe/common.hpp:19:0,
from ./include/caffe/util/db.hpp:6,
from src/caffe/util/db.cpp:1:
./include/caffe/util/device_alternate.hpp:34:23: fatal error: cublas_v2.h: No such file or directory
#include <cublas_v2.h>
^
compilation terminated.
make: *** [.build_release/src/caffe/util/db.o] Error 1
这可能是什么问题?
好吧,我不认为这是一个 Boost 问题,而是一个 Caffe 问题!
据报道,对于 Caffe 安装,请确保 set CPU_Only := 1
在您的 makefile.config
中,如下所示:
# CPU-only switch (uncomment to build without GPU support).
CPU_ONLY := 1
这是因为您的 device_alternate.hpp
有以下情况:
line 4: #ifdef CPU_ONLY
line 32: #else
line 34: #include <cublas_v2.h>
line 99: #endif
我正在学习机器学习,最近我遇到了这个:Wide-Area Image Geolocalization with Aerial Reference Imagery 。
这是一个仅根据图像预测图像 GPS 位置的网络。不用说,我很兴奋,只是发现其中一个要求:
import glob
import caffe
import numpy as np
import multiprocessing
import matplotlib.pyplot as plt
from collections import defaultdict
是 Caffe,我似乎无法安装,因为我无法安装主要先决条件:Boost
我第一次尝试运行标准sudo apt-get install libboost-all-dev
,不仅失败了:
The following packages have unmet dependencies:
libboost-all-dev : Depends: libboost-chrono-dev but it is not going to be installed
Depends: libboost-date-time-dev but it is not going to be installed
Depends: libboost-filesystem-dev but it is not going to be installed
Depends: libboost-graph-dev but it is not going to be installed
Depends: libboost-graph-parallel-dev but it is not going to be installed
Depends: libboost-iostreams-dev but it is not going to be installed
Depends: libboost-log-dev but it is not going to be installed
Depends: libboost-mpi-dev but it is not going to be installed
Depends: libboost-mpi-python-dev but it is not going to be installed
Depends: libboost-program-options-dev but it is not going to be installed
Depends: libboost-python-dev but it is not going to be installed
Depends: libboost-regex-dev but it is not going to be installed
Depends: libboost-serialization-dev but it is not going to be installed
Depends: libboost-system-dev but it is not going to be installed
Depends: libboost-thread-dev but it is not going to be installed
Depends: libboost-wave-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
它给了我一个 "but it is not going to be installed" 错误。然后我尝试从源安装:
wget -O boost_1_55_0.tar.gz http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz/download
tar xzvf boost_1_55_0.tar.gz
cd boost_1_55_0/
./bootstrap.sh --prefix=/usr/local
./b2
这很快就让我的整个终端充满了 g++ 错误。然后我尝试从头开始:
sudo apt-get --purge remove libboost-all-dev libboost-dev libboost-doc
sudo apt-get install -f
sudo dpkg --configure -a
sudo apt-get clean
sudo apt-get update
sudo apt-get install libboost1.54-dev
虽然与测试脚本一起工作:How to Install boost on Ubuntu?
当我尝试 make
咖啡时,我得到了这个:
CXX src/caffe/util/db.cpp
In file included from ./include/caffe/common.hpp:19:0,
from ./include/caffe/util/db.hpp:6,
from src/caffe/util/db.cpp:1:
./include/caffe/util/device_alternate.hpp:34:23: fatal error: cublas_v2.h: No such file or directory
#include <cublas_v2.h>
^
compilation terminated.
make: *** [.build_release/src/caffe/util/db.o] Error 1
这可能是什么问题?
好吧,我不认为这是一个 Boost 问题,而是一个 Caffe 问题!
据报道,对于 Caffe 安装,请确保 set CPU_Only := 1
在您的 makefile.config
中,如下所示:
# CPU-only switch (uncomment to build without GPU support).
CPU_ONLY := 1
这是因为您的 device_alternate.hpp
有以下情况:
line 4: #ifdef CPU_ONLY
line 32: #else
line 34: #include <cublas_v2.h>
line 99: #endif