C4-w3 unexpected error

I’m not a mentor for this course, but my interpretation of that error message is that the type of the argument you are passing to create_padding_mask is incorrect: it should be a Tensor, but it is some higher level object. So how did that happen? In TF there are a lot of cases in which functions (e.g. “layer” functions) return functions and then you call those functions with a Tensor as argument. Maybe you’ve got a case like that where you forgot to actually invoke the resulting “layer” function and just passed the function itself.



i changed the next word function but i have this new error

As I mentioned earlier, I am not a mentor for this course, so I don’t know the details of this assignment. Debugging starts with understanding what the error is telling you. My interpretation of this without understanding the actual mechanics of any of these functions is that the return value from your answer_question function is somehow not correct. It is expected to be a tensor with at least one dimension, but apparently it isn’t. So you need to figure out why that happened.

You can also see this by comparing your output versus the “Expected Output”. Your return value is 97, which is a scalar number. The expected value is a string.

@Mohammad_Ashraf1

the enc_padding_mask code is correct.

Your error is probably directing you to go back and check in previous cell, how you recalled your ids.

I would go back check if idx is being recalled correctly in my first grade cell seeing your last error.

regards
DP


i got the expected output but i got this different error

are you recall your model correctly?

You can DM the screenshot of the grade cell you got your test failed via personal DM. click on my name and then message.

Regards
DP

in code recall for next word, you are using incorrect code for model as transformer as the assigned argument for that grade cell use it as model, you are suppose to use model instead of transformer. @Mohammad_Ashraf1

Also use the search tool, you will find similar post threads for your query.

Regards
DP

1 Like

i got the same error , is the error in test file

@Mohammad_Ashraf1

The screenshot you shared didn’t mention all of the codes for the grade cell, so until I don’t know if there are more error, I cannot confirm anything. No there are no errors in test file.

Also I am hoping you are using an updated version of the assignment as there were some changes done in the assignment recently. So in case you haven’t, you might need to get a fresh copy and re-do the assignment.

Regards
DP

i send you the entire code

@Deepti_Prasad I didn’t see the file, but as I see you as team member, well ‘okay’, perhaps we step away from that thought.

i have updated the lab and code and i solve the issue , thank you for your response

1 Like

Hi @Mohammad_Ashraf1

You are using an obsolete copy of assignment. Kindly get a fresh copy and re-do your assignment.

Please refer below link comment for how to get a fresh copy.

Let me know if you still get the same error.

Also for the error which you mentioned in the first comment, it is pointing towards your input not being recalled correctly, so I would first suspect and check parse_squad grade cell as there could be some correction required on how you recalled the arguments. But in your case, first you need to do assignment on an updated assignment.

Regards
DP

I am sorry I didn’t get your question!!!

What do you mean by this?