DeepInfer / Model-Registry

4 stars 7 forks source link

ValueError trying WMH-Segmenter-K2 #14

Open fepegar opened 4 years ago

fepegar commented 4 years ago

Hi, I'm getting the following error. Do you know what could be happening?

model: wmh_segmenter
Using TensorFlow backend.
/opt/conda/lib/python3.6/site-packages/h5py/__init__.py:34: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
starting deployment and inference...
-------------------------------------- INPUT AND OUTPUT PATHS --------------------------------------
input t1 volume path: /data/t1.nrrd
input flair volume path: /data/t2_on_t1.nrrd
output label path: /data/wmh_label.nrrd
---------------------------------------- INPUT T1 IMAGE INFO ----------------------------------------
image spacing: (0.48829999999999996, 0.48829999999999996, 1.1999955414012737)
image size: (512, 512, 158)
image pixel type: 16-bit signed integer
-------------------------------------- INPUT FLAIR IMAGE INFO --------------------------------------
---------------------------------------- T1 BRAIN EXTRACTION ----------------------------------------
-------------------------------------- FLAIR BRAIN EXTRACTION --------------------------------------
-------------------------- CALCULATING OR OF THE MASKS AND MASKING INPUTS --------------------------
output path: /data/t1.nrrd
output path: /data/t2_on_t1.nrrd
----------------------------------------------------------------------------------------------------
Starting Transformation...
----------------------------------------------------------------------------------------------------
####################################################################################################
image: /data/t1.nrrd
####################################################################################################
----------------------------------------------------------------------------------------------------
original spacing: (0.4882999999999999, 0.4882999999999999, 1.1999955414012737)
original size: (512, 512, 108)
----------------------------------------------------------------------------------------------------
Resampling image...
----------------------------------------------------------------------------------------------------
Padding image...
----------------------------------------------------------------------------------------------------
Cropping image...
----------------------------------------------------------------------------------------------------
Rescale intensity...
####################################################################################################
image: /data/t2_on_t1.nrrd
####################################################################################################
----------------------------------------------------------------------------------------------------
original spacing: (0.4882999999999999, 0.4882999999999999, 1.1999955414012742)
original size: (512, 512, 108)
----------------------------------------------------------------------------------------------------
Resampling image...
----------------------------------------------------------------------------------------------------
Padding image...
----------------------------------------------------------------------------------------------------
Cropping image...
----------------------------------------------------------------------------------------------------
Rescale intensity...
model folder: /deepinfer/models/brain/wmh_segmenter/models/general1
/deepinfer/models/brain/wmh_segmenter/model.py:77: UserWarning: The `merge` function is deprecated and will be removed after 08/2017. Use instead layers from `keras.layers.merge`, e.g. `add`, `concatenate`, etc.
  x = merge([x1, x2], mode='concat', concat_axis=-1)
/opt/conda/lib/python3.6/site-packages/keras/legacy/layers.py:460: UserWarning: The `Merge` layer is deprecated and will be removed after 08/2017. Use instead layers from `keras.layers.merge`, e.g. `add`, `concatenate`, etc.
  name=name)
/deepinfer/models/brain/wmh_segmenter/model.py:100: UserWarning: The `merge` function is deprecated and will be removed after 08/2017. Use instead layers from `keras.layers.merge`, e.g. `add`, `concatenate`, etc.
  up6 = merge([UpSampling2D(size=(2, 2))(conv5), conv4_cropped], mode='concat', concat_axis=-1)
/deepinfer/models/brain/wmh_segmenter/model.py:105: UserWarning: The `merge` function is deprecated and will be removed after 08/2017. Use instead layers from `keras.layers.merge`, e.g. `add`, `concatenate`, etc.
  up7 = merge([UpSampling2D(size=(2, 2))(conv6), conv3_cropped], mode='concat', concat_axis=-1)
/deepinfer/models/brain/wmh_segmenter/model.py:110: UserWarning: The `merge` function is deprecated and will be removed after 08/2017. Use instead layers from `keras.layers.merge`, e.g. `add`, `concatenate`, etc.
  up8 = merge([UpSampling2D(size=(2, 2))(conv7), conv2_cropped], mode='concat', concat_axis=-1)
/deepinfer/models/brain/wmh_segmenter/model.py:115: UserWarning: The `merge` function is deprecated and will be removed after 08/2017. Use instead layers from `keras.layers.merge`, e.g. `add`, `concatenate`, etc.
  up9 = merge([UpSampling2D(size=(2, 2))(conv8), conv1_cropped], mode='concat', concat_axis=-1)
2019-11-07 23:12:33.186835: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2019-11-07 23:12:33.186857: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2019-11-07 23:12:33.186863: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2019-11-07 23:12:33.186868: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2019-11-07 23:12:33.186873: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
Traceback (most recent call last):
  File "deepinfer/fit.py", line 59, in <module>
    deployer.run()
  File "/deepinfer/models/brain/wmh_segmenter/deploy.py", line 139, in run
    segmenter.segment_transformed_image(transformed_images, os.path.join(output_dir, probmap_path))
  File "/deepinfer/models/brain/wmh_segmenter/segmenter.py", line 25, in segment_transformed_image
    prediction = self.__predict(processd_ndas)
  File "/deepinfer/models/brain/wmh_segmenter/segmenter.py", line 51, in __predict
    predicted_prob = model.predict(vol_nda, verbose=1)
  File "/opt/conda/lib/python3.6/site-packages/keras/engine/training.py", line 1576, in predict
    check_batch_axis=False)
  File "/opt/conda/lib/python3.6/site-packages/keras/engine/training.py", line 139, in _standardize_input_data
    str(array.shape))
ValueError: Error when checking : expected input_1 to have shape (None, 348, 348, 1) but got array with shape (48, 278, 278, 1)