# C1\_W4 assignment failed

**URL:** <https://community.deeplearning.ai/t/c1-w4-assignment-failed/242644>\
**Category:** Browser-based Models with TensorFlow.js\
**Tags:** week-module-4\
**Created:** [December 15, 2022, 10:38am UTC](https://community.deeplearning.ai/t/c1-w4-assignment-failed/242644 "2022-12-15T10:38:32Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Honza\_Zbirovsky](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/honza_zbirovsky/32/72445_2.png) [@Honza\_Zbirovsky](https://community.deeplearning.ai/u/Honza_Zbirovsky)\
**Post date:** [December 15, 2022, 10:38am UTC](https://community.deeplearning.ai/t/c1-w4-assignment-failed/242644/1 "2022-12-15T10:38:32Z")

</div>

Yesterday I finished C1\_W4 assignment with “Rock, Paper, Scissors, Lizard, Spock”. In browser **everything works like a charm** , but during submission I receive following message:

**“Can’t compile the student’s code. Error when checking input: expected flatten\_Flatten1\_input to have shape (7, 7, 256) but got array with shape (7, 7, 1024)”**

… and thereof I didn’t pass.

When I checked the size of _‘conv\_pw\_13\_relu’_ it’s **(7, 7, 1024)**. Does anyone know why (7, 7, 256) is expected to pass this exercise, please? Did I miss something here?

Any help is highly appreciated. Thanks a lot in advance!

Honza

---

<div class="post-metadata">

**Author:** ![Honza\_Zbirovsky](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/honza_zbirovsky/32/72445_2.png) [@Honza\_Zbirovsky](https://community.deeplearning.ai/u/Honza_Zbirovsky)\
**Post date:** [December 20, 2022, 11:37am UTC](https://community.deeplearning.ai/t/c1-w4-assignment-failed/242644/2 "2022-12-20T11:37:47Z")

</div>

So, I downloaded the data once again from GitHub and made that completely from scratch. **Now I passed** 🙄. When I compare the older and newer version I see no difference… So I still don’t know, what was wrong.

---

<div class="post-metadata">

**Author:** ![Imokut](https://avatars.discourse-cdn.com/v4/letter/i/0ea827/32.png) [@Imokut](https://community.deeplearning.ai/u/Imokut)\
**Post date:** [April 3, 2023, 7:11am UTC](https://community.deeplearning.ai/t/c1-w4-assignment-failed/242644/3 "2023-04-03T07:11:19Z")

</div>

I had a similar error to this when I did week 2 assignment. Same code, different array shape. I think it’s some JavaScript semantics that we don’t get

---

<div class="post-metadata">

**Author:** ![AlexLogos](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/alexlogos/32/56915_2.png) [@AlexLogos](https://community.deeplearning.ai/u/AlexLogos)\
**Post date:** [August 22, 2023, 5:53am UTC](https://community.deeplearning.ai/t/c1-w4-assignment-failed/242644/4 "2023-08-22T05:53:15Z")

</div>

Thank you Honza for raising this. I faced exactly the same error message “expected flatten\_Flatten1\_input to have shape (7, 7, 256) but got array with shape (7, 7, 1024)”. Somehow, it solved by trying the same code with newly downloaded files from git. Your report helped me a lot.

---

<div class="post-metadata">

**Author:** ![Honza\_Zbirovsky](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/honza_zbirovsky/32/72445_2.png) [@Honza\_Zbirovsky](https://community.deeplearning.ai/u/Honza_Zbirovsky)\
**Post date:** [August 22, 2023, 7:14am UTC](https://community.deeplearning.ai/t/c1-w4-assignment-failed/242644/5 "2023-08-22T07:14:57Z")

</div>

I’m glad it helped!

PS: Welcome to the Community 😉

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [August 23, 2023, 6:14am UTC](https://community.deeplearning.ai/t/c1-w4-assignment-failed/242644/6 "2023-08-23T06:14:46Z")

</div>

Hello Honza,

I am trying to the same assignment,

but I am getting this message when I try to run in the browser

One or more documents in this page is in Quirks Mode, which will render the affected document(s) with quirks incompatible with the current HTML and CSS specifications.

Quirks Mode exists mostly due to historical reasons. If this is not intentional, you can add or modify the DOCTYPE to be `<!DOCTYPE html>` to render the page in No Quirks Mode.

Can you please guide me!!!

Regards  
DP

---

<div class="post-metadata">

**Author:** ![Honza\_Zbirovsky](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/honza_zbirovsky/32/72445_2.png) [@Honza\_Zbirovsky](https://community.deeplearning.ai/u/Honza_Zbirovsky)\
**Post date:** [August 26, 2023, 4:04am UTC](https://community.deeplearning.ai/t/c1-w4-assignment-failed/242644/7 "2023-08-26T04:04:41Z")

</div>

Hi @Deepti_Prasad.

Please, **could you share what’s your current set up (browser, web server you use, etc.)**? In the time I did it, I used Chrome browser with the “Web Server for Chrome” extension. Please remember that the “[Web Server for Chrome](https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb)” extension is no longer supported (I think since June 2023 or something like this), **so you have to use another alternative**. I can try to download this assignment once more and try to do it again. Thx.

BR Honza

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [August 26, 2023, 5:02am UTC](https://community.deeplearning.ai/t/c1-w4-assignment-failed/242644/8 "2023-08-26T05:02:51Z")

</div>

Thank you Honza, I was hoping you see my post as I saw you doing the same assignment and getting the solution. Yes I am aware of the web server for chrome no longer supported. So Chris favila had done some workup and made an updated for week 3 assignment to use Coursera web environment as it required tensor flow 2.2

But in this exercise I think I am able to do the coding part but when I am change the tensor flow script to list/min.js according to post thread, for this assignment I am still running into error. Based on the video shown, what I believe once you compile the code, on the developer tool your cam should be seen but for me it is not. Is it because I am using a MacBook?

I am using Chrome browser for this assignment.

Thank you so much for trying this assignment again, I hope this isn’t trouble for you. or I should again ping Chris.favila. I already have troubled him a lot for this course 😄

I am tagging you to a post I created where I have shared screenshot of the error I am facing. Please have a look there.

Regards  
DP

---

<div class="post-metadata">

**Author:** ![Honza\_Zbirovsky](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/honza_zbirovsky/32/72445_2.png) [@Honza\_Zbirovsky](https://community.deeplearning.ai/u/Honza_Zbirovsky)\
**Post date:** [August 26, 2023, 5:10am UTC](https://community.deeplearning.ai/t/c1-w4-assignment-failed/242644/9 "2023-08-26T05:10:35Z")

</div>

Hi @Deepti_Prasad.

So, I did that completely from scratch again and you just need to do following:

1. Download Brackets in the latest [version](https://brackets.io/) and have Chrome browser installed (obviously the latest version).
2. Clone original repo from [here](https://github.com/https-deeplearning-ai/tensorflow-2-public/tree/main/C1_Browser-based-TF-JS/W4/assignment)
3. Enter the missing code
4. Run “rpsls.html” in Brackets by clicking the top right button  
 ![image](https://global.discourse-cdn.com/dlai/original/3X/c/6/c6d42de5c55a732359b64bbb037d851ccc3de504.png)
5. Enter samples for all 5 categories
6. Train the model (I didn’t do any special tuning, so don’t worry about the loss size, but it’s still pretty good 🙂 )  
 ![image](https://global.discourse-cdn.com/dlai/original/3X/f/6/f6189934c4890605f8bf51c80ac72677c744cac6.png)
7. Download the model  
 ![image](https://global.discourse-cdn.com/dlai/original/3X/2/3/23fd6dd33cb4bcbf4716e04e13033a2511b78957.png)
8. Submission

Please let me know, if it works for you.  
Greeting from the heart of Europe (=Czech republic 🙂 )!

Honza

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [August 26, 2023, 5:14am UTC](https://community.deeplearning.ai/t/c1-w4-assignment-failed/242644/10 "2023-08-26T05:14:29Z")

</div>

Hello Honza,

I already did steps till 6 which is where I am stuck, please look the post I have tagged you for the error I am coming across.

> [@I am having issue with my chrome browser not able to open my webcam to take the training images](https://community.deeplearning.ai/t/i-am-having-issue-with-my-chrome-browser-not-able-to-open-my-webcam-to-take-the-training-images/428088):
>
> Hello Mentors of TF Data and Deployment, @Honza_Zbirovsky Please only mentors of TF Data and Deployment reply as you would have better idea about what my issue might be related to. I am currently trying to do Course 1 Week 4 Assignment where in I completed my codes and ran on the web chrome browser which eventually should lead me to the page where cam should be able to take images for rock, paper and scissor, but at this stage, my camera doesn’t open in the web chrome browser nor does it show…

Regards  
DP

---

<div class="post-metadata">

**Author:** ![Honza\_Zbirovsky](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/honza_zbirovsky/32/72445_2.png) [@Honza\_Zbirovsky](https://community.deeplearning.ai/u/Honza_Zbirovsky)\
**Post date:** [August 26, 2023, 5:25am UTC](https://community.deeplearning.ai/t/c1-w4-assignment-failed/242644/11 "2023-08-26T05:25:57Z")

</div>

@Deepti_Prasad I checked the thread. I don’t have Mac and I don’t know, if this could be computer related issue. One idea could be, **if you are willing to share your code with me in a private message, I can run it on my computer to test it** (otherwise it’s pretty difficult for me to reproduce your errors). Based on the result we can plan next steps. Let me know. Thx.

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [August 26, 2023, 5:32am UTC](https://community.deeplearning.ai/t/c1-w4-assignment-failed/242644/12 "2023-08-26T05:32:52Z")

</div>

I have messaged you my notebook assignment
