在Google Colab上安装tf-nightly-gpu-2.0-preview

时间:2019-01-16 18:34:28

标签: tensorflow google-colaboratory

我想在Colab上测试具有GPU支持的新TensorFlow 2.0预览版,但是,在单元格上使用!pip install tf-nightly-gpu-2.0-preview安装TensorFlow之后,在导入程序包时出现错误:{{1 }}指出与平台上预装的CUDA版本有些不符。

2 个答案:

答案 0 :(得分:6)

解决方案是按照以下说明在Colab上重新安装CUDA 10.0:

ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory

在单元格中执行了先前的命令后,您可以导入并测试具有GPU支持的TensorFlow 2.0预览:

!wget https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64 -O cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
!dpkg -i cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
!apt-key add /var/cuda-repo-10-0-local-10.0.130-410.48/7fa2af80.pub
!apt-get update
!apt-get install cuda
!pip install tf-nightly-gpu-2.0-preview

答案 1 :(得分:1)

更改Noteboot设置以使用硬件加速器 在GPU上设置 运行之后

!pip install tf-nightly
import tensorflow as tf
print(tf.__version__)