使用 CMake 在 Google colab 上构建 dlib

Building dlib on Google colab using CMake

我正在尝试在 Google colaboratory (Ubuntu 18.04 (Bionic Beaver)) 上安装 dlib,但出现错误。

CMake 错误:

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:
CUDA_cublas_LIBRARY (ADVANCED)
linked by target "dlib" in directory /content/dlib/dlib
CUDA_curand_LIBRARY (ADVANCED)
linked by target "dlib" in directory /content/dlib/dlib
cusolver (ADVANCED)
linked by target "dlib" in directory /content/dlib/dlib

-- Configuring incomplete, errors occurred!
See also "/content/dlib/build/CMakeFiles/CMakeOutput.log".
See also "/content/dlib/build/CMakeFiles/CMakeError.log".

有关详细信息,请访问此 link: https://github.com/davisking/dlib/issues/1529

Google colab 已经在 /usr/local/cuda-9.2/targets/x86_64-linux/lib.

中拥有这些库

如何 link CMake 的路径,以便它可以找到这些库?

这是重现错误的 Google 协作 link。请注意,您需要从 developer.nvidia.com 下载 cudnn 文件。您需要登录,但可以免费下载该文件。 https://colab.research.google.com/drive/1IiOLDP20QT3JFx5pigCibDadq9orNErk

dlib 现已预装在 colab 上,因此您可以通过以下方式轻松解锁:

import dlib
help(dlib)

在 GCP Ubuntu20.04 上安装机器类型 n2d-standard-8(8 个 vCPU,32 GB 内存)

git clone https://github.com/Universe-ML21/script_install_dlib.git
sudo chmod +x script_install_dlib/auto_dlib.sh
bash script_install_dlib/auto_dlib.sh