Problem with Tensorflow version

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

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

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.

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

Please confirm which notebook you’re referring to.

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), 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)

Based on this, 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.

1 Like

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

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.

1 Like

@Pourya_Hooshmand

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