# Dls course 2 week 3 problem

**URL:** <https://community.deeplearning.ai/t/dls-course-2-week-3-problem/296405>\
**Category:** Improving Deep Neural Networks: Hyperparameter tun\
**Tags:** coursera-platform\
**Created:** [March 25, 2023, 12:31pm UTC](https://community.deeplearning.ai/t/dls-course-2-week-3-problem/296405 "2023-03-25T12:31:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sudipta\_Mukherjee1](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@Sudipta\_Mukherjee1](https://community.deeplearning.ai/u/Sudipta_Mukherjee1)\
**Post date:** [March 25, 2023, 12:31pm UTC](https://community.deeplearning.ai/t/dls-course-2-week-3-problem/296405/1 "2023-03-25T12:31:48Z")

</div>

Error occured when solving one hot matrx please help

 ![Screenshot (79)](https://global.discourse-cdn.com/dlai/original/3X/7/7/772df3f3c1ba8665e52a63d252b3aa541aeb66d7.png)

---

<div class="post-metadata">

**Author:** ![Kic](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/kic/32/76339_2.png) [@Kic](https://community.deeplearning.ai/u/Kic)\
**Post date:** [March 25, 2023, 12:44pm UTC](https://community.deeplearning.ai/t/dls-course-2-week-3-problem/296405/2 "2023-03-25T12:44:46Z")

</div>

Hi @Sudipta_Mukherjee1

Are you using [tf.one\_hot(labels, depth, axis=0)](https://www.tensorflow.org/api_docs/python/tf/one_hot)  
before passing it to the reshape() function?

**Section 2.3 Using one hot encoding** and the implementation instruction are there to help you with this exercise.

---

<div class="post-metadata">

**Author:** ![Sudipta\_Mukherjee1](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@Sudipta\_Mukherjee1](https://community.deeplearning.ai/u/Sudipta_Mukherjee1)\
**Post date:** [March 25, 2023, 12:45pm UTC](https://community.deeplearning.ai/t/dls-course-2-week-3-problem/296405/3 "2023-03-25T12:45:45Z")

</div>

i have solved it thank you
