【问题标题】:Building dlib on Google colab using CMake使用 CMake 在 Google colab 上构建 dlib
【发布时间】:2019-04-02 09:13:57
【问题描述】:

我正在尝试在 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".

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

Google colab 已经在 /usr/local/cuda-9.2/targets/x86_64-linux/lib 中提供了这些库。

如何将此路径链接到 CMake,以便它可以找到这些库?

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

【问题讨论】:

    标签: cmake google-colaboratory dlib


    【解决方案1】:

    dlib 现在已预装在 colab 上,因此您可能会被简单地解锁:

    import dlib
    help(dlib)
    

    【讨论】:

    • 我检查了 Google Colab,命令 'dlib.cuda.get_num_devices()' 给出输出 1,命令 'dlib.DLIB_USE_CUDA' 给出输出 'False',这意味着 dlib 正在识别GPU 但未在 google colab 上使用 cuda。
    • 呃,你是对的;编辑了我的答案以反映必要的解决方法。
    • 不再需要解决方法(如果您仍然分配有旧 VM,可能必须 [重置所有运行时] 一次)。
    • 感谢您的回答,现在可以使用了。您之前发布的解决方法使 dlib 能够使用 cuda,但是在执行期间 dlib 的 cnn 检测器不起作用。现在,我不需要进行任何更改,一切正常。
    【解决方案2】:

    安装在 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
    

    【讨论】:

      猜你喜欢
      • 2020-12-04
      • 1970-01-01
      • 1970-01-01
      • 2020-08-21
      • 2019-11-17
      • 1970-01-01
      • 2021-09-08
      • 2018-03-11
      • 2016-11-18
      相关资源
      最近更新 更多