Ungraded Lab: CelebA GAN Experiments C4_W4_Lab_3 AttributeError: 'DistributedDataset' object has on attribute '_variant_tensor'


In the Lab 3 CelebaA GAN Experiments, when running the #Settings block, the line

created the following AttributeError code

As I am not modifying the lab (at the moment), there’s some TPU setting/feature that had gone wrong.

Please inform with options.


Hi @jswatdlai ,
Are you running the lab outside the Coursera platform? If that is the case, probably you are using a version library different from the one used in the exercise. So, you need to update your environment.
Keep learning!

Did you try to refresh your workspace and try again??


Based on your error, it is basically mentioning variant tensor or one of tensor library is not present for the cell code to run successfully.

Also this assignment is part of ungraded lab, I have updated the post to the same.


at the beginning of this assignment you have run the below cell as it is the first cell.

install tensorflow_addons

!pip install -U tensorflow-addons

if still running into error let me know. Run all the cells one by one. Do not run all cells. Sometimes it can create such error


Hello you must be changing something because I just ran the lab abd didnt have these problem.

You can always reset the lab and try again.

I’m running the ungraded lab through google’s colab website (as I have for an number of labs in this course).

Just now, I opened the lab fresh on the site and started to run the cells individually in order.

Cell 1 ran fine, and Cell 2 generated a warning about TensorFlow Addons planned end of life in May 2024 but it ran fine.

Now Cell 3, “Setup TPU” is generating a new-to-me error:

Again, I have changed no code and am running the lab through google’s colab site:

I didn’t get as far today as I did yesterday…thanks for the suggestions and I hope for at least one more!

PS Between my initial post and this one, I’ve closed browser and had the computer powered down for at least 12 hours–reopening the lab on the colab site should work as the lab is not save-able.

Just closed and opened the browser again, logged into the colab site and started running the cells one by one again. Got a warning in the “Setup TPU” cell

But I was able to run all the cells up to the training cell which is in progress.

I’ll mark this as the solution (as it seems there was just stuff happening behind the notebook).