As we have already seen, TensorFlow 2.0 brings a lot of breaking changes, which means that we have to relearn how to use the framework. TensorFlow 1.x is the most widely used machine learning framework and so there is a lot of existing code that needs to be upgraded.
The TensorFlow engineers developed a conversion tool that can help in the conversion process: unfortunately, it relies on the tf.compat.v1 module, and it does not remove the graph nor the session execution. Instead, it just rewrites the code, prefixing it using tf.compat.v1, and applies some source code transformations to fix some easy API changes.
However, it is a good starting point to migrate a whole codebase. In fact, the suggested migration process is as follows:
- Run the migration script.
- Manually remove every tf.contrib symbol, looking for the new location of the project that was used in...