Issue with Programming Assignment: Conditional GAN Grading

Hi, there,
I am working on the C1W4A_Build_a_Conditional_GAN on Coursera. However, the auto grader keeps giving me errors (shown below) while I compile and run the codes perfectly fine on my end. The errors seem somehow related to the tensor type (float), but I have specifically made the output type float already. I also tried several versions of codes, and every one of them works well on my end, but the submission will return similar errors.

I am also attaching my codes below as well. Please let me know if there is anything I missed.

Errors:

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’”,)

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’”,)

My codes at the error cells:

{moderator edit - solution code removed}

1 Like

It looks like you stepped on the landmine documented on this thread. But your combine_vectors code is actually correct: the problem is you don’t call it and make the mistake in that case when you compute noise_and_labels.

1 Like

Thank you, it works.

1 Like

I am facing same issue how can i resolve this problem. Please let me know. All Right but grader showing me this 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’”,)

1 Like

It’s probably the problem that was pointed to on this link from my earlier reply on this thread.

1 Like