C1W4A1 - Grading Error

Hello everyone,

again i got in trouble with the grader. The notebook basically works fine. Results are good. Every cell test was passed but i got this error from the grader

Cell #7. Can’t compile the student’s code. Error: RuntimeError(“Expected object of scalar type Long but got scalar type Float for sequence element 1 in sequence argument at position #1 ‘tensors’”,)

I’m pretty sure that the problem comes with the constraint that combined must be float.

My solution here was to add a .type after the concat. (hard to describe without pasting that line of code)

Can someone give me a hint what i’m doing wrong here?

Many thanks in advance!

blame on me. Solved.
Not the result should be float but the input to the cat should be.
Damn…
:wink:

3 Likes

Glad to hear that you found the solution under your own power. My guess is that it was the same issue as discussed on this thread.

2 Likes

I had the same issue today. I changed it to float on input variables x and y instead of after concat but got a diff error now. Been trying to debug but can’t figure it out.

I tried to re-run and re-submit and got this error message now:

Sorry, your submission was incorrect. Please try again. Invalid control character at: line 2377 column 28576 (char 8765440)

That sounds like the grader is getting confused by the output of your training runs. It doesn’t need to see that. Try this:

Kernel -> Restart and Clear Output
Save
Submit

The point is that the grader only needs to call your functions, not check your output and if the output is voluminous it can cause problems.

1 Like

Thanks Paul. Especially on a nice Saturday!

That’s what I thought – about the huge ouput. I tried to re-run couple times but still got same error. I’ll try to clear output and save before submit to see if it will pass.

Thanks again Paul

I passed with flying color.

Thanks, Paul!

1 Like

That’s great news. The key point is what I mentioned above: the grader does not need to see your output. It only needs to call your functions. So even if the output does not confuse the grader as in your case, it’s still faster to submit the “Clear” notebook. Minimal data equals better performance.

1 Like

Thank you for the great tip, Paul. :+1: