You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Breaking change loss function in the reconstruction tutorial. #1349
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.
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):
Hi @Can-Zhao ,
Could you please help to take a loot at this issue? I saw the data_range parameter of the loss changed every iteration in the reconstruction code. However, the new version loss just initialized it once in the __init__ function. I don't know if there is a graceful way to adapt the new version of SSIMLoss in the reconstruction code.
Activity
binliunls commentedon Apr 26, 2023
Hi @Can-Zhao ,
Could you please help to take a loot at this issue? I saw the
data_rangeparameter of the loss changed every iteration in the reconstruction code. However, the new version loss just initialized it once in the__init__function. I don't know if there is a graceful way to adapt the new version ofSSIMLossin the reconstruction code.Thanks,
Bin
wyli commentedon Apr 26, 2023
that's discussed here Project-MONAI/MONAI#6267 (comment)
cc @ericspod @Warvito
fixes Project-MONAI#1349
wyli commentedon Apr 27, 2023
I think one way to fix it is to create the loss later in the pipeline #1351 (untested)
1349 breaking change SSIMLoss (#1351)
1349 breaking change SSIMLoss (Project-MONAI#1351)