# Week 1: Assignment 2: Conv2D giving syntax error

**URL:** <https://community.deeplearning.ai/t/week-1-assignment-2-conv2d-giving-syntax-error/103020>\
**Category:** Convolutional Neural Networks\
**Tags:** coursera-platform\
**Created:** [February 25, 2022, 10:40am UTC](https://community.deeplearning.ai/t/week-1-assignment-2-conv2d-giving-syntax-error/103020 "2022-02-25T10:40:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhishek2195](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@Abhishek2195](https://community.deeplearning.ai/u/Abhishek2195)\
**Post date:** [February 25, 2022, 10:40am UTC](https://community.deeplearning.ai/t/week-1-assignment-2-conv2d-giving-syntax-error/103020/1 "2022-02-25T10:40:52Z")

</div>

i have an error regarding tfl.Conv2D, which says ‘invalid syntax’ regarding tfl.Conv2D, does anyone can help me how I can fix it?

here is the code that I have used:

tfl.Conv2D(32,(7,7),strides=(1,1))

---

<div class="post-metadata">

**Author:** ![vsnupoudel](https://avatars.discourse-cdn.com/v4/letter/v/53a042/32.png) [@vsnupoudel](https://community.deeplearning.ai/u/vsnupoudel)\
**Post date:** [February 25, 2022, 3:48pm UTC](https://community.deeplearning.ai/t/week-1-assignment-2-conv2d-giving-syntax-error/103020/2 "2022-02-25T15:48:43Z")

</div>

Umm… When you do  
´´´print(tfl)´´´  
, what does it say?

---

<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:** [February 25, 2022, 3:51pm UTC](https://community.deeplearning.ai/t/week-1-assignment-2-conv2d-giving-syntax-error/103020/3 "2022-02-25T15:51:19Z")

</div>

Have you checked the docpage for Conv2D? How many of those parameters are positional versus named? Also are you doing the Sequential API or the Functional API here? If the latter, that statement gives a function. If the former, then you need a comma at the end, right?

The other generic thing to check for is the usual missing close paren on the previous line.

---

<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:** [February 25, 2022, 3:52pm UTC](https://community.deeplearning.ai/t/week-1-assignment-2-conv2d-giving-syntax-error/103020/4 "2022-02-25T15:52:59Z")

</div>

> [@vsnupoudel](#):
>
> Umm… When you do  
> ´´´print(tfl)´´´  
> , what does it say?

The import cell defines that as an alias for _tensorflow.keras.layers_.

---

<div class="post-metadata">

**Author:** ![Abhishek2195](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@Abhishek2195](https://community.deeplearning.ai/u/Abhishek2195)\
**Post date:** [February 26, 2022, 3:49am UTC](https://community.deeplearning.ai/t/week-1-assignment-2-conv2d-giving-syntax-error/103020/5 "2022-02-26T03:49:37Z")

</div>

Thanks for your reply. I am doing sequential API and after seeing this post I just remember that i forgot to put the comma at the end of each line.

Now my code works fine
