Skip to content

Breaking change loss function in the reconstruction tutorial. #1349

@binliunls

Description

@binliunls

Describe the bug
Because of this PR, there is a breaking change in the SSIMLoss. Unfortunatelly, this loss is used in the varnet reconstruction demo . Therefore, this tutorial must be updated according to this change.

To Reproduce
Steps to reproduce the behavior:

  1. Start a MONAI 1.2.0rc5 docker
  2. Following the README file in the varnet reconstruction demo to setup the dataset.
  3. Run commands
python ./train.py\
    --data_path_train train_dir \
    --data_path_val val_dir \
    --exp varnet_mri_recon \
    --exp_dir ./ \
    --mask_type equispaced \
    --num_epochs 50 \
    --num_workers 0 \
    --lr 0.00001

Expected behavior
Start to train.

Screenshots

  File "/workspace/tutorials/monai/reconstruction/MRI_reconstruction/varnet_demo/train.py", line 186, in trainer
    loss = loss_function(output_crp, tar, max_value)
  File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
TypeError: forward() takes 3 positional arguments but 4 were given

Environment (please complete the following information):

  • Python version: 3.8.10
  • MONAI version 1.2.0rc5
  • CUDA: 12.1

Metadata

Metadata

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