# Issue with Programming Assignment: Conditional GAN Grading

**URL:** <https://community.deeplearning.ai/t/issue-with-programming-assignment-conditional-gan-grading/412037>\
**Category:** Build Basic Generative Adversarial Networks\
**Tags:** week-module-4\
**Created:** [August 8, 2023, 3:23pm UTC](https://community.deeplearning.ai/t/issue-with-programming-assignment-conditional-gan-grading/412037 "2023-08-08T15:23:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liwen\_Hu](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Liwen\_Hu](https://community.deeplearning.ai/u/Liwen_Hu)\
**Post date:** [August 8, 2023, 3:23pm UTC](https://community.deeplearning.ai/t/issue-with-programming-assignment-conditional-gan-grading/412037/1 "2023-08-08T15:23:15Z")

</div>

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}_

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [August 8, 2023, 4:07pm UTC](https://community.deeplearning.ai/t/issue-with-programming-assignment-conditional-gan-grading/412037/2 "2023-08-08T16:07:20Z")

</div>

It looks like you stepped on the landmine [documented on this thread](https://community.deeplearning.ai/t/cant-compile-the-students-code-runtimeerror/289318/7). 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`.

---

<div class="post-metadata">

**Author:** ![Liwen\_Hu](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Liwen\_Hu](https://community.deeplearning.ai/u/Liwen_Hu)\
**Post date:** [August 8, 2023, 4:39pm UTC](https://community.deeplearning.ai/t/issue-with-programming-assignment-conditional-gan-grading/412037/3 "2023-08-08T16:39:30Z")

</div>

Thank you, it works.

---

<div class="post-metadata">

**Author:** ![Imran\_Shahzad](https://avatars.discourse-cdn.com/v4/letter/i/c0e974/32.png) [@Imran\_Shahzad](https://community.deeplearning.ai/u/Imran_Shahzad)\
**Post date:** [November 1, 2023, 10:02am UTC](https://community.deeplearning.ai/t/issue-with-programming-assignment-conditional-gan-grading/412037/4 "2023-11-01T10:02:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [November 1, 2023, 5:15pm UTC](https://community.deeplearning.ai/t/issue-with-programming-assignment-conditional-gan-grading/412037/5 "2023-11-01T17:15:05Z")

</div>

It’s probably the problem that was pointed to on [this link from my earlier reply on this thread.](https://community.deeplearning.ai/t/cant-compile-the-students-code-runtimeerror/289318/7)

---

<div class="post-metadata">

**Author:** ![Fei\_Yan](https://avatars.discourse-cdn.com/v4/letter/f/ea666f/32.png) [@Fei\_Yan](https://community.deeplearning.ai/u/Fei_Yan)\
**Post date:** [October 15, 2024, 1:15am UTC](https://community.deeplearning.ai/t/issue-with-programming-assignment-conditional-gan-grading/412037/6 "2024-10-15T01:15:10Z")

</div>

Thanks a lot, solved my problem also!
