Closed DecentMakeover closed 5 years ago
Take a look at the bus_train.py file from line 80:
gt1 = imgs_mask_train[:,::8,::8,:] gt2 = imgs_mask_train[:,::4,::4,:] gt3 = imgs_mask_train[:,::2,::2,:] gt4 = imgs_mask_train gt_train = [gt1,gt2,gt3,gt4]
By performing the operations on my training data prior to fitting the model I managed to avoid the error.
Hi
I am trying to use the attn_reg_ds and attn_reg and this is how it looks at the end.
and i have modified the function to look like this
def class_tversky(y_true, y_pred): smooth = 1
but when i run this i get
DUnetCNN/unet3d/training.py", line 88, in train_model early_stopping_patience=early_stopping_patience)) File "/usr/local/lib/python3.6/dist-packages/keras/legacy/interfaces.py", line 91, in wrapper return func(*args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/keras/engine/training.py", line 2230, in fit_generator class_weight=class_weight) File "/usr/local/lib/python3.6/dist-packages/keras/engine/training.py", line 1877, in train_on_batch class_weight=class_weight) File "/usr/local/lib/python3.6/dist-packages/keras/engine/training.py", line 1480, in _standardize_user_data exception_prefix='target') File "/usr/local/lib/python3.6/dist-packages/keras/engine/training.py", line 86, in _standardize_input_data str(len(data)) + ' arrays: ' + str(data)[:200] + '...') ValueError: Error when checking model target: the list of Numpy arrays that you are passing to your model is not the size the model expected. Expected to see 4 array(s), but instead got the following list of 1 arrays: [array([[[[[1, 1, 1, ..., 1, 1, 1], [1, 1, 1, ..., 1, 1, 1], [1, 1, 1, ..., 1, 1, 1], ..., [1, 1, 1, ..., 1, 1, 1], [1, 1, 1, ..., 1, 1, 1],
Any idea on what the issue might be?
Thanks