# Browser-based Models with TensorFlow.js C1\_W4 assignment

**URL:** <https://dlai.staged-by-discourse.com/t/browser-based-models-with-tensorflow-js-c1-w4-assignment/187296>\
**Category:** TensorFlow: Data and Deployment Specialization\
**Tags:** week-module-4\
**Created:** [August 17, 2022, 10:08am UTC](https://dlai.staged-by-discourse.com/t/browser-based-models-with-tensorflow-js-c1-w4-assignment/187296 "2022-08-17T10:08:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roman\_Popov](https://sea1.discourse-cdn.com/dlaistaging/user_avatar/dlai.staged-by-discourse.com/roman_popov/32/126621_2.png) [@Roman\_Popov](https://dlai.staged-by-discourse.com/u/Roman_Popov)\
**Post date:** [August 17, 2022, 10:08am UTC](https://dlai.staged-by-discourse.com/t/browser-based-models-with-tensorflow-js-c1-w4-assignment/187296/1 "2022-08-17T10:08:34Z")

</div>

Have a problem, when using ‘[https://storage.googleapis.com/tfjs-models/tfjs/mobilenet\_v1\_0.25\_224/model.json](https://storage.googleapis.com/tfjs-models/tfjs/mobilenet_v1_0.25_224/model.json)’ model for the assignment the model trains and I can predict and save the model, but when I submit it flatten\_Flatten1\_input should have shape (7, 7, 256) but got array with shape (7, 7, 1024).  
When I use the suggested model ‘[https://storage.googleapis.com/tfjs-models/tfjs/mobilenet\_v1\_1.0\_224/model.json](https://storage.googleapis.com/tfjs-models/tfjs/mobilenet_v1_1.0_224/model.json)’ the model in training gets an error WebGL:

‘’‘CONTEXT\_LOST\_WEBGL: loseContext: context lost  
uncaught (in promise) Error: Failed to compile fragment shader.’‘’

and I can neither predict nor save the model for submission, what should I do in this case?  
Basically the problem is the mobilenet model itself, because if I use another everything works perfectly fine, just the grader is unhappy!!!

---

<div class="post-metadata">

**Author:** ![Umadata](https://avatars.discourse-cdn.com/v4/letter/u/bbce88/32.png) [@Umadata](https://dlai.staged-by-discourse.com/u/Umadata)\
**Post date:** [September 9, 2022, 12:12pm UTC](https://dlai.staged-by-discourse.com/t/browser-based-models-with-tensorflow-js-c1-w4-assignment/187296/2 "2022-09-09T12:12:01Z")

</div>

Hello Roman,

I am also facing the same issue. Have you solved the above issue? Let me know your workaround for this issue.

Regards,  
Uma

---

<div class="post-metadata">

**Author:** ![Roman\_Popov](https://sea1.discourse-cdn.com/dlaistaging/user_avatar/dlai.staged-by-discourse.com/roman_popov/32/126621_2.png) [@Roman\_Popov](https://dlai.staged-by-discourse.com/u/Roman_Popov)\
**Post date:** [September 9, 2022, 1:14pm UTC](https://dlai.staged-by-discourse.com/t/browser-based-models-with-tensorflow-js-c1-w4-assignment/187296/3 "2022-09-09T13:14:39Z")

</div>

Hi, only solution that worked for me was doing it from linux, tried other browsers in windows, had the same problem, you could use virtual box and install linux on it, or install linux on separate disk partition.

Hope it helps, good luck!

---

<div class="post-metadata">

**Author:** ![Umadata](https://avatars.discourse-cdn.com/v4/letter/u/bbce88/32.png) [@Umadata](https://dlai.staged-by-discourse.com/u/Umadata)\
**Post date:** [September 14, 2022, 5:37am UTC](https://dlai.staged-by-discourse.com/t/browser-based-models-with-tensorflow-js-c1-w4-assignment/187296/4 "2022-09-14T05:37:59Z")

</div>

Thanks for the suggestion. I will try that.
