Generating text using a character-based RNN

The last lab in week 4, the generating text using a character-based RNN lab… it looks outdated by a couple of years and I cannot get it to run in collab.

Specifically the model, class MyModel, is broken… probably in the super initializer. But even getting around that the problem cascades in the call() function. Probably has something to do “if states is None:”

1 Like

Hi @Carl_Hickman

Can I know what is the issue, you can share a screenshot if any error is being encountered without sharing any part of the codes from grade cell.

Also can I know when you took the course 3 of this specialisation, so I know you are on which version of course as this course was recently updated.

regards
DP

I started course 3 on July 20th, 2024.

The lab is not graded. The screenshot of the error is

If I change the class so that the call to super is “super().init()” the error goes away but then this error crops up.

Thank you for the images, can I know are you running the codes in coursera provided colab or your local colab?

1 Like

I followed the class link, and clicked on Google collab.

class link means the Coursera provided page for the course, but on the post created comment you shared repo link, as we click the assignment or course provided page, it would colab but in coursera environment, which in your case doesn’t seem, so that’s why I asked this question first. Because the error show MyModel if it was upgraded lab also it must have come with utils.py file but your points towards input dimensions not matching

Tagging @chris.favila just make sure if there is any issue at our side. He is L.T of the course.

@chris.favila can you look at this issue, it is ungraded lab as he seems to be mostly working older version of the course.

Hi Carl and welcome to the Forum! This is due to breaking changes in the TF version used by Colab (v2.17). We’ll look into updating the notebook. For now, you can restart your session and add this code up top to roll back the version before importing TF.

!pip install tensorflow==2.15
!pip install keras==2.15

The notebook should work fine then. Thanks for reporting!

2 Likes

hi Chris
i got this issue too. Is there a reason why it cant find 2.15? Here is screenshot: Many thanks for your help.

@Cormac_Garvey this is the reason it doesn’t work, so the L.T wants you to download the version the notebook was worked upon until notebook is updated.

Hi Cormac. It seems you’re running the notebook from your own computer so it would be hard for me to troubleshoot. I suspect you have to configure something in the package manager to see versions pre-2.16. I suggest using Coursera Labs for now so you can run the notebook.