Cell #UNQ_C4. Can’t compile the student’s code. Error: RuntimeError(“Expected object of scalar type Float but got scalar type Long for sequence element 1 in sequence argument at position #1 ‘tensors’”,)
This is the justification for the 0/5 grade I got how ever I got for each section test, Success!
Also I got this after running UNQ_C4
Congratulations! If you’ve gotten here, it’s working. Please let this train until you’re happy with how the generated numbers look, and then go on to the exploration!
Please show us the message under “Show grader output”. Perhaps that will be a clue as to what the issue is. As I mentioned above, any kind of exception from the grader results in 0 score, because it can’t complete the evaluation.
Could you pls tell me how to solve this problem? I met the same issue and tried to transform the type of labels too but it didn’t work. I will very appreciated
Still having the same problem, changed the code to torch.cat((x,y),dim=1).float() to pass the test cell but it triggers the error:
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’”,)
In case of changing the code (assuming it is the cell#7) to torch.cat((x.float(), y.float()), dim=1) the grader error becomes:
Cell #7. Can’t compile the student’s code. Error: AssertionError()
Now that I think about this a bit more, another thing to check is that there are no other invocations of torch.cat in other cells. If so, you need to call combine_vectors instead of reimplementing it “in situ”.
Maybe it’s worth saying just a bit more about the implications of this way to submit for anyone else who sees this thread:
The point is that the grader does not need to see the output of your code in the notebook: it only needs to call your functions to test the results. Running the notebook can frequently increase the memory footprint quite a bit, especially in notebooks that involve training a model. Clearing the output before submitting makes the grading process as efficient as possible by minimizing the size of the notebook image that needs to get uploaded to the grader. There also are some edge cases where there is syntax in the generated output that can confuse the grader’s parser. Clearing the output also protects against that scenario.