sergivalverde / nicMSlesions

Easy multiple sclerosis white matter lesion segmentation using convolutional deep neural networks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue when predicting

RIMcKinley opened this issue · comments

I'm having trouble with applying a model (trained on my own data, with three input modalities.) Specifically, at the end of predicting a case I got the following:

`
...

DEBUG: testing current_batch: (128, 3, 11, 11, 11)
DEBUG: testing current_batch: (128, 3, 11, 11, 11)
DEBUG: testing current_batch: (1, 3, 11, 11, 11)
Traceback (most recent call last):
File "nic_infer_segmentation_batch.py", line 149, in
out_seg = test_cascaded_model(model, test_x_data, options)
File "/data/disk2/nicmslesions/nicMSlesions/libs/CNN/base.py", line 157, in test_cascaded_model
save_nifti=save_nifti)
File "/data/disk2/nicmslesions/nicMSlesions/libs/CNN/base.py", line 552, in test_scan
options['batch_size'])
File "/home/user/anaconda3/envs/nicmslesions/lib/python2.7/site-packages/keras/engine/training.py", line 1554, in predict
check_batch_axis=False)
File "/home/user/anaconda3/envs/nicmslesions/lib/python2.7/site-packages/keras/engine/training.py", line 121, in _standardize_input_data
str(array.shape))
ValueError: Error when checking : expected in1 to have 5 dimensions, but got array with shape (3, 11, 11, 11)
'

Three other cases worked fine. I suppose maybe it has something to do with a batch-size of 1?