1

我在 google colab 中安装了 TensorFlow 版本 2:

!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.13.0-dev20190116

当我想使用 tf.enable_eager_execution() 和 NameError: name 'layers' is not defined 时我也有错误

4

1 回答 1

1

试试这样:

!pip install tf-nightly-2.0-preview
import tensorflow as tf

正如Luca解释的那样,检查您需要的版本:

print(tf.__version__)
于 2019-01-28T16:59:20.413 回答