I just installed new tf and cuda today, but when I run the previous code that worked with tf-1.4 won't work under new tensorflow-2.1.0 and cuda-10.1
How to fix this?
Mentioning the Solution in the Answer Section (even though it is present in Comments Section), for the benefit of the Community.
Replacing the command,
import tensorflow as tf
with
import tensorflow.compat.v1 as tf
has resolved the error.
For more information about Migrating from Tensorflow 1.x to 2.x, please refer this Tensorflow Tutorial and this Upgrade Script also will be helpful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With