Hvass-Labs / TensorFlow-Tutorials

TensorFlow Tutorials with YouTube Videos
MIT License
9.28k stars 4.19k forks source link

TensorFlow 2.0 #115

Closed Hvass-Labs closed 4 years ago

Hvass-Labs commented 4 years ago

These tutorials were developed in 2016-2017 for early versions of TensorFlow and modified slightly when the TensorFlow API changed during the following years. But TensorFlow has recently seen a major upgrade in late 2019 to v. 2.0 with many breaking API changes. I will eventually go through the tutorials and see if it makes sense to upgrade some of them to support TensorFlow 2.0, but the new TensorFlow version is currently too buggy and unstable.

The last TensorFlow version that I know worked with all the tutorials (unless described in the Notebooks) was TensorFlow v. 1.9.0. Unfortunately that version is not available anymore. You can try installing TensorFlow v. 1.14.0 but not everything may work.

pip install tensorflow==1.14

When I made these tutorials 3 years ago, TensorFlow was very poorly designed and documented. That is why I felt these tutorials were necessary. I pleaded with the Google developers to focus more on API design. But the person in charge of API design was extremely stubborn and demanded that TensorFlow had a very low-level API. This resulted in maybe 5 high-level API's being developed independently. Eventually the Keras API became the winner. Finally after 3 years, the Google developers have understood, that a good API is important, so they have made Keras the default builder API for TensorFlow 2.0 along with other API changes.

But I am not convinced that TensorFlow 2.0 is going to the last major reworking of the TensorFlow API, and it may not be worth the time and effort for me to continue updating these tutorials every time the Google developers decide to change the TensorFlow API.

I have heard that PyTorch is much better designed than TensorFlow, although I haven't tried PyTorch myself, as I have been working on completely different things for a while. But you could try using PyTorch instead of TensorFlow and see how you like it.

Joggyjagz7 commented 4 years ago

Thanks for the update

Hvass-Labs commented 4 years ago

Several of the tutorials have now been updated to work with TensorFlow 2. Some of the tutorials have to run in "v. 1 compatibility mode". Other tutorials simply cannot run in TF2 and would take too much effort to convert, so you will have to run them with an older TF1 version.

mobile-appz commented 3 years ago

Several of the tutorials have now been updated to work with TensorFlow 2. Some of the tutorials have to run in "v. 1 compatibility mode". Other tutorials simply cannot run in TF2 and would take too much effort to convert, so you will have to run them with an older TF1 version.

Hi, great work with the tutorials. Yours is the best tutorial I found on this subject for absolute AI beginners, all others on Github seem to assume a lot more TF knowledge. Have just noticed you said "Some of the tutorials have to run in "v. 1 compatibility mode". In case people are unsure how to use this mode with TF2, it was possible to run the "07 Inception Model" tutorial in TF2 making the following change to line 58 of inception.py: replace "import tensorflow as tf" with "import tensorflow.compat.v1 as tf"

Haven't tried this with any other of your TF1 tutorials, but hopefully this might help someone who is new to this and just wants to get something working quickly.

Thanks