# Problem with Tensorflow version

**URL:** <https://dlai.staged-by-discourse.com/t/problem-with-tensorflow-version/187909>\
**Category:** Convolutional Neural Networks in TensorFlow\
**Tags:** week-module-3\
**Created:** [August 18, 2022, 8:55am UTC](https://dlai.staged-by-discourse.com/t/problem-with-tensorflow-version/187909 "2022-08-18T08:55:37Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pourya\_Hooshmand](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@Pourya\_Hooshmand](https://dlai.staged-by-discourse.com/u/Pourya_Hooshmand)\
**Post date:** [August 18, 2022, 8:55am UTC](https://dlai.staged-by-discourse.com/t/problem-with-tensorflow-version/187909/1 "2022-08-18T08:55:37Z")

</div>

The last few notebooks that I tried to run gave this error

```nohighlight
in ()
7 epochs = 100,
8 verbose = 1,
----> 9 callbacks=callbacks)

1 frames
/usr/local/lib/python3.7/dist-packages/tensorflow/python/eager/execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
53 ctx.ensure_initialized()
54 tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
—> 55 inputs, attrs, num_outputs)
56 except core._NotOkStatusException as e:
57 if name is not None:

InvalidArgumentError: Graph execution error:

```

So I searched a bit and it seems like the codes in the notebooks don’t work in the latest version of TensorFlow which Google collab uses(specifically I think it’s flow\_from\_directory). So please either update the course materials or add `!pip install tensorflow==2.0` to the first cell so it changes the version to an older one

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlaistaging/user_avatar/dlai.staged-by-discourse.com/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://dlai.staged-by-discourse.com/u/balaji.ambresh)\
**Post date:** [August 18, 2022, 9:21am UTC](https://dlai.staged-by-discourse.com/t/problem-with-tensorflow-version/187909/2 "2022-08-18T09:21:58Z")

</div>

Assignment notebooks are set to run on tensorflow 2.7.x in the provided coursera / google colab environment.  
There’s no need to downgrade tensorflow.

There’s another error in the code. If you’re unable to find the error, please click my name and message your notebook as an attachment.

---

<div class="post-metadata">

**Author:** ![Pourya\_Hooshmand](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@Pourya\_Hooshmand](https://dlai.staged-by-discourse.com/u/Pourya_Hooshmand)\
**Post date:** [August 18, 2022, 9:46am UTC](https://dlai.staged-by-discourse.com/t/problem-with-tensorflow-version/187909/3 "2022-08-18T09:46:04Z")

</div>

It happens for the lab notebooks too. When I tried to downgrade it the version was 2.9 but it worked when I downgraded.

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlaistaging/user_avatar/dlai.staged-by-discourse.com/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://dlai.staged-by-discourse.com/u/balaji.ambresh)\
**Post date:** [August 18, 2022, 9:49am UTC](https://dlai.staged-by-discourse.com/t/problem-with-tensorflow-version/187909/4 "2022-08-18T09:49:49Z")

</div>

Please confirm which notebook you’re referring to.

---

<div class="post-metadata">

**Author:** ![Pourya\_Hooshmand](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@Pourya\_Hooshmand](https://dlai.staged-by-discourse.com/u/Pourya_Hooshmand)\
**Post date:** [August 18, 2022, 9:54am UTC](https://dlai.staged-by-discourse.com/t/problem-with-tensorflow-version/187909/5 "2022-08-18T09:54:15Z")

</div>

The ones that I tried were week 3 lab ([tensorflow-1-public/C2\_W3\_Lab\_1\_transfer\_learning.ipynb at main · https-deeplearning-ai/tensorflow-1-public · GitHub](https://github.com/https-deeplearning-ai/tensorflow-1-public/blob/main/C2/W3/ungraded_lab/C2_W3_Lab_1_transfer_learning.ipynb)), week 3 assignment (google colab gave the error but the grader accepted it), and week 4 lab ([tensorflow-1-public/C2\_W4\_Lab\_1\_multi\_class\_classifier.ipynb at main · https-deeplearning-ai/tensorflow-1-public · GitHub](https://github.com/https-deeplearning-ai/tensorflow-1-public/blob/main/C2/W4/ungraded_lab/C2_W4_Lab_1_multi_class_classifier.ipynb))

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlaistaging/user_avatar/dlai.staged-by-discourse.com/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://dlai.staged-by-discourse.com/u/balaji.ambresh)\
**Post date:** [August 18, 2022, 9:59am UTC](https://dlai.staged-by-discourse.com/t/problem-with-tensorflow-version/187909/6 "2022-08-18T09:59:22Z")

</div>

Based on [this](https://stackoverflow.com/questions/71000120/colab-0-unimplemented-dnn-library-is-not-found), please run the following in the first cell:  
`!apt install --allow-change-held-packages libcudnn8=8.4.1.50-1+cuda11.6`

Restart your runtime and then execute rest of the cells.

Try one more time and confirm.

---

<div class="post-metadata">

**Author:** ![Pourya\_Hooshmand](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@Pourya\_Hooshmand](https://dlai.staged-by-discourse.com/u/Pourya_Hooshmand)\
**Post date:** [August 18, 2022, 10:11am UTC](https://dlai.staged-by-discourse.com/t/problem-with-tensorflow-version/187909/7 "2022-08-18T10:11:28Z")

</div>

Yes it fixed the error but it happens again when I open another notebook

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlaistaging/user_avatar/dlai.staged-by-discourse.com/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://dlai.staged-by-discourse.com/u/balaji.ambresh)\
**Post date:** [August 18, 2022, 10:12am UTC](https://dlai.staged-by-discourse.com/t/problem-with-tensorflow-version/187909/8 "2022-08-18T10:12:43Z")

</div>

Thanks for confirming.  
Sorry to hear that other notebooks don’t work. This is google colab issue. The staff have been notified to fix this.  
That said, you an always use docker or run tensorflow work on your personal machine.

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlaistaging/user_avatar/dlai.staged-by-discourse.com/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://dlai.staged-by-discourse.com/u/balaji.ambresh)\
**Post date:** [August 18, 2022, 11:52am UTC](https://dlai.staged-by-discourse.com/t/problem-with-tensorflow-version/187909/9 "2022-08-18T11:52:43Z")

</div>

@Pourya_Hooshmand

The staff have fixed this issue. Please get the new version of the notebook and try again.
