Here is how we proceed with the recipe:
- First, download tf_upgrade.py from https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/compatibility.
- If you want to convert one file from TensorFlow 0.x to TensorFlow 1.0, use the following command at the command line:
python tf_upgrade.py --infile old_file.py --outfile upgraded_file.py
- For example, if you have a TensorFlow program file named test.py, you will use the preceding command as follows:
python tf_upgrade.py --infile test.py --outfile test_1.0.py
- This will result in the creation of a new file named test_1.0.py.
- If you want to migrate all the files of a directory, then use the following at the command line:
python tf_upgrade.py --intree InputDIr --outtree ...