From 5a9161140532264c3d44190e6d82cfb8120fbfe7 Mon Sep 17 00:00:00 2001 From: Himanshu maurya Date: Thu, 29 Jul 2021 15:49:39 +0530 Subject: [PATCH] Changed filter to filters in _conv2d() Does not give error TypeError: conv2d_v2() got an unexpected keyword argument 'filter' as mentioned in https://stackoverflow.com/questions/64033469/typeerror-conv2d-v2-got-an-unexpected-keyword-argument-filter --- .../Week 4/Art Generation/nst_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Convolutional Neural Networks/Week 4/Art Generation/nst_utils.py b/Convolutional Neural Networks/Week 4/Art Generation/nst_utils.py index af34181..4f0dcab 100644 --- a/Convolutional Neural Networks/Week 4/Art Generation/nst_utils.py +++ b/Convolutional Neural Networks/Week 4/Art Generation/nst_utils.py @@ -108,7 +108,7 @@ def _conv2d(prev_layer, layer, layer_name): W, b = _weights(layer, layer_name) W = tf.constant(W) b = tf.constant(np.reshape(b, (b.size))) - return tf.nn.conv2d(prev_layer, filter=W, strides=[1, 1, 1, 1], padding='SAME') + b + return tf.nn.conv2d(prev_layer, filters=W, strides=[1, 1, 1, 1], padding='SAME') + b def _conv2d_relu(prev_layer, layer, layer_name): """ @@ -185,4 +185,4 @@ def save_image(path, image): # Clip and Save the image image = np.clip(image[0], 0, 255).astype('uint8') - scipy.misc.imsave(path, image) \ No newline at end of file + scipy.misc.imsave(path, image)