Hi, I don’t understand how to call Conv2d_0 layer. I just assign “vars(self)[f’conv2D_{0}']” to the conv2d_0 variable, but I know this implementation is wrong. I also don’t understand the vars concept and why did we do it. Can somebody explain these two things in a little bit detail please? Thank You

# C1_W4 Assignment - Conv2D_0 layer

Course Q&A
TensorFlow: Advanced Techniques Specialization
Custom Models, Layers and Loss Functions with TF

Maybe this page can be helpful to you:

https://www.toppr.com/guides/python-guide/references/methods-and-functions/methods/built-in/vars/python-vars/

Literally the error means that you are trying to use a list as a function i.e. list(5) instead of list[5]. But you are getting this error because you are using self. for x=…

You already defined conv_2D in the line above using self. now you can call it without self.

I tried that too, but I still got the same error. Can you confirm if `conv2D_0 = vars(self)['conv2D_0']`

implementation is correct or not? If not, then please explain how to implement this

I’ve got it now. I was making a mistake in the **init** function. Thanks for your help

1 Like