cnn_finetune icon indicating copy to clipboard operation
cnn_finetune copied to clipboard

TypeError: 'module' object is not callable

Open amuthalingeswaranbose opened this issue 5 years ago • 2 comments

WARNING:tensorflow:From C:\Users\HP\Anaconda3\envs\tf-gpu-v2\lib\site-packages\keras\backend\tensorflow_backend.py:4267: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

.\resnet_101.py:72: UserWarning: Update your Conv2D call to the Keras 2 API: Conv2D(64, (1, 1), name="res2a_branch2a", strides=(1, 1), use_bias=False) name=conv_name_base + '2a', bias=False)(input_tensor) .\resnet_101.py:79: UserWarning: Update your Conv2D call to the Keras 2 API: Conv2D(64, (3, 3), name="res2a_branch2b", use_bias=False) name=conv_name_base + '2b', bias=False)(x) .\resnet_101.py:84: UserWarning: Update your Conv2D call to the Keras 2 API: Conv2D(256, (1, 1), name="res2a_branch2c", use_bias=False) x = Convolution2D(nb_filter3, 1, 1, name=conv_name_base + '2c', bias=False)(x) .\resnet_101.py:89: UserWarning: Update your Conv2D call to the Keras 2 API: Conv2D(256, (1, 1), name="res2a_branch1", strides=(1, 1), use_bias=False) name=conv_name_base + '1', bias=False)(input_tensor) Traceback (most recent call last): File ".\resnet_101.py", line 193, in model = resnet101_model(img_rows, img_cols, channel, num_classes) File ".\resnet_101.py", line 131, in resnet101_model x = conv_block(x, 3, [64, 64, 256], stage=2, block='a', strides=(1, 1)) File ".\resnet_101.py", line 93, in conv_block x = merge([x, shortcut], mode='sum', name='res' + str(stage) + block) TypeError: 'module' object is not callable

when i execute the code i get the above error. please help me to solve the error.

amuthalingeswaranbose avatar Feb 12 '20 04:02 amuthalingeswaranbose

Did you manage to solve your problem? I am currently encountering the same issue.

IWamelink avatar Mar 10 '20 21:03 IWamelink

from keras.layers import add

Replace x = merge([x, shortcut], mode='sum', name='res' + str(stage) + block) by x = add([x, shortcut], name='res' + str(stage) + block)

this solved the error for me .

aayushgavande avatar Aug 24 '20 19:08 aayushgavande