Why is TensorFlow 2 much slower than TensorFlow 1?

It’s been cited by many users as the reason for switching to Pytorch, but I’ve yet to find a justification/explanation for sacrificing the most important practical quality, speed, for eager execution. Below is code benchmarking performance, TF1 vs. TF2 – with TF1 running anywhere from 47% to 276% faster. My question is: what is it, … Read more

Tensorflow 2.0 – AttributeError: module ‘tensorflow’ has no attribute ‘Session’

When I am executing the command sess = tf.Session() in Tensorflow 2.0 environment, I am getting an error message as below: Traceback (most recent call last): File “<stdin>”, line 1, in <module> AttributeError: module ‘tensorflow’ has no attribute ‘Session’ System Information: OS Platform and Distribution: Windows 10 Python Version: 3.7.1 Tensorflow Version: 2.0.0-alpha0 (installed with … Read more

How to prevent tensorflow from allocating the totality of a GPU memory?

I work in an environment in which computational resources are shared, i.e., we have a few server machines equipped with a few Nvidia Titan X GPUs each. For small to moderate size models, the 12 GB of the Titan X is usually enough for 2–3 people to run training concurrently on the same GPU. If … Read more