I am currently trying to make a research paper's source code work. It's supposed to be able to detect cells on an image using deep learning. The source code is available here : https://github.com/WeidiXie/cell_counting_v2
I'm using Python 3.9.5 and keras 2.5.0.
I've been having some issues trying to make this code work properly, I am getting errors that I'm not sure how to resolve. This happens when I compile train.py :
Traceback (most recent call last):
File "D:\Fac\Stage L2\Travail\train.py", line 126, in <module>
train_(base_path)
File "D:\Fac\Stage L2\Travail\train.py", line 87, in train_model = buildModel_U_net(input_dim = (256,256,3))
File "D:\Fac\Stage L2\Travail\model.py", line 173, in buildModel_U_net
act_ = U_net_base (input_, nb_filter = 64 )
File "D:\Fac\Stage L2\Travail\model.py", line 123, in U_net_baseblock1 = _conv_bn_relu_x2(nb_filter,3,3)(input)
File "D:\Fac\Stage L2\Travail\model.py", line 57, in fconv_a = Convolution2D(nb_filter, row, col, subsample = subsample,
File "C:\Users\Cinna\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\layers\convolutional.py", line 656, in __init__super(Conv2D, self).__init__(
File "C:\Users\Cinna\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\layers\convolutional.py", line 125, in __init__
super(Conv, self).__init__(
File "C:\Users\Cinna\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\training\tracking\base.py", line 522, in _method_wrapper
result = method(self, *args, **kwargs)
File "C:\Users\Cinna\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\engine\base_layer.py", line 323, in __init__
generic_utils.validate_kwargs(kwargs, allowed_kwargs)
File "C:\Users\Cinna\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\utils\generic_utils.py", line 1134, in validate_kwargs
raise TypeError(error_message, kwarg)
TypeError: ('Keyword argument not understood:', 'subsample')
From my understanding, there's an issue with the parameters on line 57 in model.py, they are not recognized ;
conv_a = Convolution2D(nb_filter, row, col, subsample = subsample,
init = 'orthogonal', border_mode = 'same',bias = False,
W_regularizer = l2(weight_decay),
b_regularizer = l2(weight_decay))(input)
I found out if I modified keras configuration's file base_layer.py and added more "acceptable" parameters in the list on line 312 I wouldn't get those errors anymore, but it seems weird that this would be the way to go
allowed_kwargs = {
'input_dim',
'input_shape',
'batch_input_shape',
'batch_size',
'weights',
'activity_regularizer',
#'subsample',
#'init',
#'border_mode',
#'bias',
#'W_regularizer',
#'b_regularizer',
'autocast',
'implementation',
}
I'd prefer to only modify the source code on the project and not kera's, I just don't understand how. There's got to be a reason these keywords aren't in the configuration file, but how am I supposed to make it work then ?
Thanks,