# Tf2 training much slower than tf?

**URL:** <https://discuss.ray.io/t/tf2-training-much-slower-than-tf/3648>\
**Category:** RLlib\
**Created:** [September 27, 2021, 11:30pm UTC](https://discuss.ray.io/t/tf2-training-much-slower-than-tf/3648 "2021-09-27T23:30:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![captainzhao](https://avatars.discourse-cdn.com/v4/letter/c/ea5d25/32.png) [@captainzhao](https://discuss.ray.io/u/captainzhao)\
**Post date:** [September 27, 2021, 11:30pm UTC](https://discuss.ray.io/t/tf2-training-much-slower-than-tf/3648/1 "2021-09-27T23:30:44Z")

</div>

Hi there,

I was comparing tf and tf2 training speed by training a dummy environment. I noticed that the tf2 training is much slower (10x) than the tf training. Is this expected?

Thanks,  
Longyu

---

<div class="post-metadata">

**Author:** ![gjoliver](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/gjoliver/32/1490_2.png) [@gjoliver](https://discuss.ray.io/u/gjoliver)\
**Post date:** [September 27, 2021, 11:48pm UTC](https://discuss.ray.io/t/tf2-training-much-slower-than-tf/3648/2 "2021-09-27T23:48:49Z")

</div>

yeah, tf2 is much slower than tf.  
do you have eager\_tracing turned on like:

–config=’{“framework”: “tf2”, “eager\_tracing”: True}’

? that will make things much faster. but still a bit slower than tf I heard.

---

<div class="post-metadata">

**Author:** ![captainzhao](https://avatars.discourse-cdn.com/v4/letter/c/ea5d25/32.png) [@captainzhao](https://discuss.ray.io/u/captainzhao)\
**Post date:** [September 28, 2021, 12:12am UTC](https://discuss.ray.io/t/tf2-training-much-slower-than-tf/3648/3 "2021-09-28T00:12:21Z")

</div>

Thanks, this is indeed much faster! Although from documentation it shows eager\_tracing only possible if framework=tfe. I used tfe and it is much faster.

---

<div class="post-metadata">

**Author:** ![stefanbschneider](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/stefanbschneider/32/232_2.png) [@stefanbschneider](https://discuss.ray.io/u/stefanbschneider)\
**Post date:** [September 28, 2021, 3:50pm UTC](https://discuss.ray.io/t/tf2-training-much-slower-than-tf/3648/4 "2021-09-28T15:50:51Z")

</div>

@gjoliver I didn’t know eager mode made such a difference in speed. Do you know why it’s disabled by default?
