O'Reilly logo

Deep Learning with TensorFlow by Ahmed Menshawy, Md. Rezaul Karim, Giancarlo Zaccone

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to upgrade using the script

The tf_upgrade.py script helps you to upgrade your 0.x source codes to 1.x (or higher) compatible. This script can be downloaded from GitHub at https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/compatibility. To convert a single 0.x TensorFlow source file to 1.x (or higher) issue a command in following format:

For Python 2.7 type the following command:

$ python tf_upgrade.py --infile InputFile --outfile OutputFile

For Python 3.3+n type the following command:

$ python3 tf_upgrade.py --infile InputFile --outfile OutputFile 

For example, suppose you have a script named five_layers_relu.py which is 0.x compatible written on Python 2.7 with the following code:

import mnist_data  import tensorflow ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required