Skip to content

kits23 tutorial infers only one segment #1896

@anadb

Description

@anadb

I have trained my model as it was wriiten in readme with command python -m monai.apps.auto3dseg AutoRunner run --input=./input.yaml --algos=segresnet.

However when I try to run an inference to obtain a file with segmentation I have only one segment with no tumor indication.

What am I doing incorrect?

Command for inference python scripts/infer.py run --config_file=configs/hyper_parameters.yaml

hyper_parameters.yaml

_meta_: {}
bundle_root: /home/anatoly/Documents/kidney_tumor_segmentation/tutorials/auto3dseg/tasks/kits23/work_dir/segresnet_4
ckpt_path: $@bundle_root + '/model'
mlflow_tracking_uri: $@ckpt_path + '/mlruns/'
mlflow_experiment_name: Auto3DSeg
data_file_base_dir: /home/anatoly/Documents/kidney_tumor_segmentation/tutorials/auto3dseg/tasks/kits23/data/kits23
data_list_file_path: /home/anatoly/Documents/kidney_tumor_segmentation/tutorials/auto3dseg/tasks/kits23/work_dir/kits23_folds.json
modality: ct
fold: 4
input_channels: 1
output_classes: 3
class_names: [kidney_and_mass, mass, tumor]
class_index:
- [1, 2, 3]
- [2, 3]
- [2]
debug: false
ckpt_save: true
cache_rate: null
roi_size: [256, 256, 256]
auto_scale_allowed: false
auto_scale_batch: true
auto_scale_roi: false
auto_scale_filters: false
quick: false
channels_last: true
validate_final_original_res: true
calc_val_loss: false
amp: true
log_output_file: null
cache_class_indices: null
early_stopping_fraction: 0.001
determ: false
orientation_ras: true
crop_foreground: true
learning_rate: 0.0002
batch_size: 1
num_images_per_batch: 1
num_epochs: 600
num_warmup_epochs: 3
sigmoid: true
resample: true
resample_resolution: [0.78125, 0.78125, 0.78125]
crop_mode: ratio
normalize_mode: range
intensity_bounds: [-54.36023523373594, 242.71830265848672]
num_epochs_per_validation: null
num_epochs_per_saving: 1
num_workers: 4
num_steps_per_image: null
num_crops_per_image: 1
loss: {_target_: DiceCELoss, include_background: true, squared_pred: true, smooth_nr: 0,
  smooth_dr: 1.0e-05, softmax: $not @sigmoid, sigmoid: $@sigmoid, to_onehot_y: $not
    @sigmoid}
optimizer: {_target_: torch.optim.AdamW, lr: '@learning_rate', weight_decay: 1.0e-05}
network:
  _target_: SegResNetDS
  init_filters: 32
  blocks_down: [1, 2, 2, 4, 4]
  norm: INSTANCE_NVFUSER
  in_channels: '@input_channels'
  out_channels: '@output_classes'
  dsdepth: 4
finetune: {enabled: false, ckpt_name: $@bundle_root + '/model/model.pt'}
validate: {enabled: false, ckpt_name: $@bundle_root + '/model/model.pt', output_path: $@bundle_root
    + '/prediction_validation', save_mask: false, invert: true}
infer: {enabled: false, ckpt_name: $@bundle_root + '/model/model.pt', output_path: $@bundle_root
    + '/prediction_' + @infer#data_list_key, data_list_key: testing}
anisotropic_scales: false
spacing_median: [0.78125, 0.78125, 3.0]
spacing_lower: [0.4602125036716461, 0.4602123200893402, 0.5]
spacing_upper: [0.9765625, 0.9765625, 5.0]
image_size_mm_median: [400.0, 400.0, 417.0]
image_size_mm_90: [487.2, 487.2, 552.8499999999999]
image_size: [623, 623, 707]

kits23_folds.json

{
    "testing": [
       {
            "image": "dataset/case_00000/imaging.nii.gz",
            "label": "dataset/case_00000/segmentation.nii.gz",
            "fold": 4
        }
    ]
}

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions