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
In MONAI version 0.8.0, UnetResBlock creates a conv3 layer regardless of its use, leading to unnecessary weight inclusion in the SwinUNETR architecture within the DAE ssl weights. Specifically, conv3 layers in encoder2, encoder3, encoder4, and encoder10 seem redundant as these blocks have identical input and output feature dimensions. This redundancy becomes problematic when upgrading to MONAI v0.9.0+, where conv3 is only instantiated if needed, causing errors due to missing layers.
In Monai v0.9.0+ the conv3 layer is created conditionally based on input and output channels. The DAE ssl weights includes conv3 in all UnetResBlocks, also in layers where they are not used. When loading ssl weights when finetuning using the DAE/BTCV_Finetune repositiory using Monai v0.9.0+ the code throws error since the expected conv3 layers are never created.
load_from in DAE/BTCV_Finetune/swin_unetr_og.py includes the following lines:
Avoid loading weights for conv3 in blocks encoder2, encoder3, encoder4 and encoder10, where the input and output feature sizes are the same, to ensure compatibility with newer monai versions.
Could also be beneficial to remove the mentioned weights from DAE_SSL_WEIGHTS to avoid further confusion.
The text was updated successfully, but these errors were encountered:
Description
In MONAI version 0.8.0, UnetResBlock creates a conv3 layer regardless of its use, leading to unnecessary weight inclusion in the SwinUNETR architecture within the DAE ssl weights. Specifically, conv3 layers in encoder2, encoder3, encoder4, and encoder10 seem redundant as these blocks have identical input and output feature dimensions. This redundancy becomes problematic when upgrading to MONAI v0.9.0+, where conv3 is only instantiated if needed, causing errors due to missing layers.
Monai v0.8.0 snippet shows unconditional creation:
In Monai v0.9.0+ the conv3 layer is created conditionally based on input and output channels. The DAE ssl weights includes conv3 in all UnetResBlocks, also in layers where they are not used. When loading ssl weights when finetuning using the DAE/BTCV_Finetune repositiory using Monai v0.9.0+ the code throws error since the expected conv3 layers are never created.
load_from in DAE/BTCV_Finetune/swin_unetr_og.py includes the following lines:
Proposed solution
Avoid loading weights for conv3 in blocks encoder2, encoder3, encoder4 and encoder10, where the input and output feature sizes are the same, to ensure compatibility with newer monai versions.
Could also be beneficial to remove the mentioned weights from DAE_SSL_WEIGHTS to avoid further confusion.
The text was updated successfully, but these errors were encountered: