Zju-George / zju-zi2zi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Migrate from Tensorflow v1 to Tensorflow v2

ahmed-hassan19 opened this issue · comments

Can you please migrate it from Tensorflow v1 to Tensorflow v2?

To upgrade to the latest TensorFlow version (v2.2 at the time of writing), you can upgrade by inputting into your terminal as follows (assuming you are using Python 3):

pip3 install --upgrade tensorflow --user

You should note that by upgrading, it is possible that some code scripts written for TF v1 may not execute properly. Therefore, you may wish to disable TF v2 behaviour in some instances until the code is compatible with TF v2.

This can be done as follows:

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

Hope this helps.