Trouble Running the Ungraded Labs (always leads to errors)

The Course 2 Week 3 ungraded lab 1:

I have been having this issue for the duration of the entire certificate, so I wanted to bring this up. I can never run the ungraded labs without some cell throwing an error. An example screenshot is attached. Laurence’s output is also attached below. When I try to fix it with the assistance of the built-in Gemini chatbot, it still doesn’t work. It’s weird because Laurence can run it in the videos without any issues. Any tips? Thanks!

Mine:

Laurence’s (in video " Exploring Transfer Learning with Inception", timestamp: 0:28):

Chatbots are not programming experts.

Coursera jupyter labs run on tensorflow 2.7.x
Google colab uses tensorflow 2.17 which doesn’t play well with code written for 2.7.x (see colab output below)

image

The staff are aware of this.

But the error above happened in the google colab notebook, not the jupyter notebook. All of the 2nd course assignments were administered through Google Colab. Is there a way to resolve this? I would really like to be able to play with the ungraded labs on my own. Thanks!

Sure.

Use docker to get hold of legacy images. Start here

I see. Thanks for this resource. I’m kind of new to docker, so how exactly can I use it? Like at a high level, how can Docker help?

  1. Install docker on your machine and ensure that dockerd is running.
  2. Run the following command to map the current working directory on the host machine to /tf/notebooks and launch the notebook server:
docker container run --rm -it --network host -v $PWD:/tf/notebooks tensorflow/tensorflow:2.7.4-gpu-jupyter

Pick an image that matches your hardware (like check for gpu)

Hi Achintya! Thank you for reporting this! For this lab, please downgrade tensorflow to v2.15 if you want to keep using Colab. You can run this in the first cell.

!pip install tensorflow==2.15.0
!pip install keras==2.15.0

TF2.17 uses Keras 3 by default which can indeed cause bugs if the code expects Keras 2. We’re working on patching the labs so other learners won’t run into the same issue. Thank you!

1 Like