How to load the pre-trained model and infer with it?
Opened this issue · 4 comments
Hi @qgao21, as I commented on issue #14, I am opening this issue to discuss how to load and infer with the pre-trained model.
I am diving into your code to test your CoreDiff model over different data than Mayo 2016 dataset. I am currently trying to load the pre-trained model you made available and use it to infer over a set of images but I am struggling to understand how to do so...
Would you mind sharing a code snippet for doing that?
Thanks in advance!
Hello, @Gigarrum, you only need to follow the steps below in order:
- Download the latest code and the pretrained model (
ema_150000
). - Create the directory
./output/dose25_mayo_2016/save_models
and place the pretrained model (ema_150000
) in it. - Execute the script
test_mayo2016.sh
.
May be I am wrong but I think it will only work for Mayo2016 dataset, right?
What about testing in a custom dataset? What I am trying is to load the model weights and use it in a custom python script where I have my specific routine to access data and infer over it.
My plan is to initially test your pre-trained model as-it-is just to test the pipeline and its performance over the other dataset. Futurally, I plan to finetune it with some data from this other dataset I have.
This pre-trained model can also be used to inference other datasets. To do so, simply refer to the data preprocessing script prep_mayo2016.py
to prepare your own test data.
If you want to use the one-shot learning framework for generalization, run train_osl_framework.sh
, change the run_name
with the save path of the pre-trained model, and modify the test_dataset
as needed.