handson-ml icon indicating copy to clipboard operation
handson-ml copied to clipboard

TensorFlow 2.0

Open Dess1996 opened this issue 5 years ago • 3 comments

Could you adapt your code to the TensorFlow 2.0? I have some problems with it.

Dess1996 avatar Jan 18 '20 11:01 Dess1996

This book uses TensorFlow 1.0, as you may have already surmised. Since 1.0 and 2.0 are different major versions, it's expected that they are not backwards/forwards compatible.

TensorFlow's site has some tutorials which are very similar to exercises in this book, but it would require significant effort to refactor all the code in the book to 2.0.

DCtheTall avatar Jan 21 '20 00:01 DCtheTall

Could you adapt your code to the TensorFlow 2.0? I have some problems with it.

Try importing Tensorflow with the following code and see if it works:

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

And then run your codes in the first edition of the book.

But eventually you will have to learn TensorFlow 2. If I am not mistaken Aurelien (the author) has recently published another edition of the book, and I think it uses TensorFlow 2 (it says on the cover "updated for TensorFlow 2").

AbdullahDawud avatar Jan 24 '20 16:01 AbdullahDawud

You have it here https://github.com/ageron/handson-ml2

hiraksarkar avatar Apr 10 '20 21:04 hiraksarkar