Стремительное исполнение в Tensorflow 2 - PullRequest
0 голосов
/ 30 января 2019

Я тестирую код в Google Colab.Похоже, что Google Colab запускает версию 2 Tensorflow по умолчанию:

[In:]
import tensorflow as tf
print(tf.__version__)

[Out:]
2.0.0-dev20190130

и что эта версия не требует быстрого выполнения:

[In:]
tf.enable_eager_execution()

[Out:]
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-ddf3115bdcc7> in <module>()
----> 1 tf.enable_eager_execution()

AttributeError: module 'tensorflow' has no attribute 'enable_eager_execution'

Я не смог найти документацию по TensorFlow 2Также я не мог запустить более старую версию TensorFlow:

[In:]
!pip install tensorflow==1.12.0
import tensorflow as tf
print(tf.__version__)

[Out:]
Requirement already satisfied: tensorflow==1.12.0 in /usr/local/lib/python3.6/dist-packages (1.12.0)
Requirement already satisfied: six>=1.10.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.12.0) (1.11.0)
Requirement already satisfied: absl-py>=0.1.6 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.12.0) (0.7.0)
Requirement already satisfied: astor>=0.6.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.12.0) (0.7.1)
Requirement already satisfied: protobuf>=3.6.1 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.12.0) (3.6.1)
Requirement already satisfied: gast>=0.2.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.12.0) (0.2.2)
Requirement already satisfied: tensorboard<1.13.0,>=1.12.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.12.0) (1.12.2)
Requirement already satisfied: wheel>=0.26 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.12.0) (0.32.3)
Requirement already satisfied: keras-preprocessing>=1.0.5 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.12.0) (1.0.5)
Requirement already satisfied: grpcio>=1.8.6 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.12.0) (1.15.0)
Requirement already satisfied: termcolor>=1.1.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.12.0) (1.1.0)
Requirement already satisfied: keras-applications>=1.0.6 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.12.0) (1.0.6)
Requirement already satisfied: numpy>=1.13.3 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.12.0) (1.14.6)
Requirement already satisfied: setuptools in /usr/local/lib/python3.6/dist-packages (from protobuf>=3.6.1->tensorflow==1.12.0) (40.7.0)
Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.6/dist-packages (from tensorboard<1.13.0,>=1.12.0->tensorflow==1.12.0) (3.0.1)
Requirement already satisfied: werkzeug>=0.11.10 in /usr/local/lib/python3.6/dist-packages (from tensorboard<1.13.0,>=1.12.0->tensorflow==1.12.0) (0.14.1)
Requirement already satisfied: h5py in /usr/local/lib/python3.6/dist-packages (from keras-applications>=1.0.6->tensorflow==1.12.0) (2.8.0)
2.0.0-dev20190130

И этот поток из 5 месяцев назад предполагает, что мы не можем понизить версию Tensorflow.

Возможно ли этовключить активное исполнение в Google Colab?

1 Ответ

0 голосов
/ 30 января 2019

В TensorFlow 2.0 Eager выполнение по умолчанию включено.Не нужно его настраивать.

...