Dinosaurus Island Character output of model() only slightly different

Hi, I have seen similar problems, but their solution does not apply to my case, since I am already using the shuffled variable in the loop. I get an output that is very close but not the same as the assert test. All the tests before this one passed. This is my error at model() function. Can someone please help?
j = 0 idx = 0
single_example = turiasaurus
single_example_chars [‘t’, ‘u’, ‘r’, ‘i’, ‘a’, ‘s’, ‘a’, ‘u’, ‘r’, ‘u’, ‘s’]
single_example_ix [20, 21, 18, 9, 1, 19, 1, 21, 18, 21, 19]
X = [None, 20, 21, 18, 9, 1, 19, 1, 21, 18, 21, 19]
Y = [20, 21, 18, 9, 1, 19, 1, 21, 18, 21, 19, 0]

Iteration: 0, Loss: 23.087336

Nkzxwtdmfqoeyhsqwasjkjvu
Kneb
Kzxwtdmfqoeyhsqwasjkjvu
Neb
Zxwtdmfqoeyhsqwasjkjvu
Eb
Xwtdmfqoeyhsqwasjkjvu

j = 1535 idx = 1535
j = 1536 idx = 0
Iteration: 2000, Loss: 27.884160

Liusskeomnolxeros
Hmdaairus
Hytroligoraurus

Feaeropakrus
Trocephodynnosaurus


AssertionError Traceback (most recent call last)
in
1 parameters, last_name = model(data.split(“\n”), ix_to_char, char_to_ix, 22001, verbose = True)
2
----> 3 assert last_name == ‘Trodonosaurus\n’, “Wrong expected output”
4 print(“\033[92mAll tests passed!”)

AssertionError: Wrong expected output

If you are using the coursera jupyter lab environment / have setup your local environment to match coursera package versions, please click my name and message your notebook as an attachment.

1 Like

@akhtarshah

The notebook you sent via direct message works on the coursera environment. Where did you face a problem?

I believe it is an environment issue then. I was running it locally. Thanks for taking out the time to answer the question!

Yes, running locally can give different results because of “versionitis”. These courses were last updated in a major way in April 2021, so they use the versions of all the various packages that were current at that time. If you run things locally with the latest version of TF and all the other packages, there is no guarantee it will even work, let alone give the same answers. The software in this environment mutates pretty rapidly and (unfortunately) not always in a backwards compatible fashion. :scream_cat: