-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
One problem came when I was using SwinUNETR to train my own data #350
Comments
@tangy5 Hi! |
Hi @wangbaoyuanGUET ,great to see you are training your own data. looks like the model checkpoint is not good enough, not related to Swin-UNETR parameter
Following your successful prediction, you could check if everything else is the same except the backbone. Hope above helps and let me know if you have more details or findings. |
@tangy5 |
Hi! Mr.Tangy @tangy5 |
Hi! Mr.Tangy. I am the Chinese postgraduate student who asked you a
question before and you gave me a great answer.So then I finished the last
work. Now I have another question on my next work. Specific:
I want to train a backbone encoder(ViT encoder) to make segmentation
on Vrterial phase image and I need the encoder to learn extra knowledge
from Arterial phase image. So I let two different phase images going
through two identical Encoders and make them into Embeddings. Before the
Vrterial phase embedding upsample on the decoder, I hope to calculate
the similarity on the two embeddings on different phase to restrict the
Vrterial phase encoder.
Do you think it's feasible? Or is there any way to calculate their
similarity?
Thank you very much. Mr.Tang.🥰
tangy5 ***@***.***> 于2024年1月6日周六 14:25写道:
… Hi @wangbaoyuanGUET <https://github.com/wangbaoyuanGUET> ,great to see
you are training your own data. looks like the model checkpoint is not good
enough, not related to Swin-UNETR parameter
, or maybe there are errors in the pre-processing steps.
you could check:
1. whether the image is padded to 64x64x64. (Add spatial pad transform)
2. monitor the validation metrics to see if the model training is
converged. transformer models are typically harder to converge.
3. Whether loss functions are properly set with 2 classes.
4. Input/output channels is correct.
5. When doing inference, whether the model checkpoint is loaded.
Following your successful prediction, you could check if everything else
is the same except the backbone.
Hope above helps and let me know if you have more details or findings.
—
Reply to this email directly, view it on GitHub
<#350 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BC3OAMTQDBZW42JPTG7PSP3YNDU6HAVCNFSM6AAAAABBPH3IROVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZZGU3TCMJYGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I'm a graduate student from China interested in deep learning. Recently I'm using MONAI framework on my project, I think it't very high-efficient and convenient. But I faced a problem bothering me for a long time when I use SwinUNTER to train my own data.Next I will explain how I did it.
Firstly, I know that SwinUNETR can be trained directly on BTCV which has 13 classes, but my data contains 2 classes, background and liver tumor, so I change the out_channels to 2.
And the size of my data is 512x512, the size of the z-axis is probably between 40 and 60, so I change the roi_size to (64, 64, 64 ). I don't know what will happened if the z-axis of roi_size is larger than my data, but it doesn't raise any mistake so I keep it.
The above modifications allowed me to train with SwinUNETR and my own successfully.
To compute the loss of the output and ground truth, I modify some code in the test.py which is shown in the figure below.
And I turned on save_checkpoint to save the .pt files so that I can test SwinUNETR and my own net on the test set.
But something strange happened on the image after the prediction.
A rectangular prediction box appears around the predicted image, but this part is blank in the original image and does not have any labels.I think maybe it's caused by the size of Roi_size and feature_size...Because the z-axis of my own data doesn't equal to the BTCV data set.
Such a situation does't appear on my own net.
The figure below shows my own network prediction, I still use the SwinUNETR training framework, but I replaced the network with my own, so I guess some of the parameters of Swin UNETR are wrong.
I don't know what's wrong. I changed a lot of Swin UNETR's hyperparameters, but the problem wasn't solved.
The text was updated successfully, but these errors were encountered: