Replies: 9 comments 12 replies
-
Hi, Thank you for your interest in GaNDLF. It seems like you are combining a segmentation task with classification loss and metrics. Perhaps you can try to replicate the following tutorial, which describes solving a segmentation problem for 3D radiology scans? https://mlcommons.github.io/GaNDLF/getting_started/#segmentation-using-3d-radiology-images |
Beta Was this translation helpful? Give feedback.
-
Dear Sarthak, Thank you very much for your promt response. I'm working on a 'Classification' task. I'm using as input 3D MRI volumes, 4 modalities per subject. The classes to predict are: '0' and '1' Here is my data structure: SubjectID,Channel_0,Channel_1,Channel_2,Channel_3,ValueToPredict I follow this section: Classification using 3D Radiology Images of the tutorial: https://mlcommons.github.io/GaNDLF/getting_started/#segmentation-using-3d-radiology-images I'm using a modified version of the config file : https://github.com/mlcommons/GaNDLF/blob/master/samples/config_getting_started_regression_rad3d.yaml batch_size: 1
clip_grad: null
clip_mode: null
data_augmentation: {}
data_postprocessing: {}
data_postprocessing_after_reverse_one_hot_encoding: {}
data_preprocessing:
normalize: null
enable_padding: false
grid_aggregator_overlap: crop
in_memory: false
inference_mechanism:
grid_aggregator_overlap: crop
patch_overlap: 0
learning_rate: 0.001
loss_function: mse
medcam_enabled: false
metrics:
- accuracy
- f1
- precision
- recall
modality: rad
model:
amp: false
architecture: densenet
base_filters: 64
class_list:
- 0
- 1
data_type: FP32
dimension: 3
final_layer: softmax
ignore_label_validation: null
norm_type: batch
num_channels: 4
num_classes: 2
onnx_export: false
print_summary: false
save_at_every_epoch: false
type: torch
nested_training:
testing: -5
validation: -5
num_epochs: 1
optimizer:
type: adam
parallel_compute_command: ''
patch_sampler: uniform
patch_size:
- 64
- 64
- 64
patience: 1
pin_memory_dataloader: false
print_rgb_label_warning: true
problem_type: classification
q_max_length: 1
q_num_workers: 0
q_samples_per_volume: 1
q_verbose: false
save_output: false
save_training: false
scaling_factor: 1
scheduler:
step_size: 0.0002
type: triangle
track_memory_usage: false
verbose: false
version:
maximum: 0.0.17
minimum: 0.0.14
weighted_loss: true I got this warnings: my_path/anaconda3/envs/venv_gandlf/lib/python3.8/site-packages/GANDLF/losses/regression.py:201: UserWarning: Using a target size (torch.Size([1, 1])) that is different to the input size (torch.Size([1, 2])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size. my_path/envs/venv_gandlf/lib/python3.8/site-packages/torchio/data/image.py:131: UserWarning: Not specifying the image type is deprecated and will be mandatory in the future. You can probably use tio.ScalarImage or tio.LabelMap instead Finally, after completing the training, validation, and test, when executing gandlf_collectStats I got this message: Segmentation task detected, generating dice and loss plots, and the plots generated are empty. I appreciate your help! |
Beta Was this translation helpful? Give feedback.
-
Yes, it's my fault. I was referring to https://mlcommons.github.io/GaNDLF/getting_started/#classification-using-3d-radiology-images. I have actually used that configuration, making minor changes since I have 2 classes instead of 3, and my channels are 4 instead of 1. Despite that, I still get the aforementioned errors. |
Beta Was this translation helpful? Give feedback.
-
Yes, I deleted the contents before. output_dir Subfolders 'output_testing' and 'output_validation' are empty. |
Beta Was this translation helpful? Give feedback.
-
config_getting_started_classification_rad3d.zip |
Beta Was this translation helpful? Give feedback.
-
This is the output of collectStats |
Beta Was this translation helpful? Give feedback.
-
Thanks ! |
Beta Was this translation helpful? Give feedback.
-
I got this error: Traceback (most recent call last): |
Beta Was this translation helpful? Give feedback.
-
I installed the nightly build version |
Beta Was this translation helpful? Give feedback.
-
GaNDLF Version
Version: 0.0.16.
Desktop (please complete the following information):
How did you install GaNDLF
I followed the installation guide
Dataset description
MRI scans, 4 modalities, 240 x 240 x 155
Describe your question/problem
I got this error after run training:
UserWarning: Using a target size (torch.Size([1, 1])) that is different to the input size (torch.Size([1, 2, 64, 64, 64])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.
loss = F.mse_loss(prediction, target, reduction=reduction)
Looping over training data: 0%| | 0/125 [00:03<?, ?it/s]
ERROR: shape '[1, 1]' is invalid for input of size 262144
My config file:
Beta Was this translation helpful? Give feedback.
All reactions