Closed mzccccccc closed 1 month ago
Hi, many thanks for your attention to our work, and sorry for my late reply. If you want to split new data set, you should write a new json file as https://github.com/Luffy03/VoCo/blob/main/Finetune/BTCV/dataset/dataset_0.json. If you want to change the data address, you should change the argument "data_dir" as https://github.com/Luffy03/VoCo/blob/94ed426bec328b7b9b5ddcf25b43fc14f27672ab/Finetune/BTCV/main.py#L52
Dear author, thanks for your reply, I still have some questions:
Thank you for your reply. Sorry to bother you again. I have a few more questions:
2.“ If you don't have enough storage, you can change it back in "utils/data_utils.py". How can I change it? Replace the PersistentDataset with a Dataset?
Thank you very much for your reply. Sorry to bother you again. I run the code from val.pt in BCTV, first showing no attribute 'cache_dir' then I add a directory to it, and then running it again shows: KeyError: 'image_meta_dict'. It seems that the dictionary does not contain data of type 'image_meta_dict'. What should I do?
Sorry, it is a bug that I forgot to revise it. https://github.com/Luffy03/VoCo/blob/8ccc7a4bc545b5ddbfff26ac8076418aa5ae76c8/Finetune/BTCV/utils/data_utils.py#L102 If we use cache then we may not use 'totensor', since 'totensor' will tranform the data from dict to tensor. Would you please delete 'totensor' in train_ and val_transform and try again?
Still displayed: KeyError: 'image_meta_dict' Are there any special requirements for the 'cache_dir' path setting? I randomly set a path for it
'cache_dir' is a local device path to store the data after processing. After revising https://github.com/Luffy03/VoCo/blob/8ccc7a4bc545b5ddbfff26ac8076418aa5ae76c8/Finetune/BTCV/utils/data_utils.py#L102, you need to delete the data in this path and re-cache the data again. You can change 'PersistentDataset' to 'Dataset' if you don't want to cache.
I deleted the data in the 'cache_dir' path and rerun val.py, still showing: KeyError: 'image_meta_dict'. Am I missing any steps? I used VoCo_10k.pt to train in main.py in BTCV, and the generated model.pt was run in val.pt. The PersistentDataset was not changed
Are there any problems when using 'Dataset'? Would you please share your 'data_utils.py'?
data_utils.zip val.zip I downloaded the BCTV dataste from Hugging Face,No problems occur when running trainer.py
thanks a lot ,sorry can only upload zip
Seems no problem with the codes. What's the version of your MONAI? Have you downloaded the packages according to https://github.com/Luffy03/VoCo/blob/main/requirements.txt? Would you please try to use 'Dataset' instead of 'PersistentDataset' and see whether there is a problem?
I output batch_data in val.py , and data in metatensor is all 0, which should be wrong?maybe there is a mistake in my train?
my MONAI version is 1.3.1 when i replace 'PersistentDataset' ,will appear TypeError: init() got an unexpected keyword argument 'pickle_protocol'
Please refer to the usage of 'Dataset' first, I have provided the link https://docs.monai.io/en/stable/data.html#dataset. https://github.com/Luffy03/VoCo/blob/8ccc7a4bc545b5ddbfff26ac8076418aa5ae76c8/Finetune/BTCV/utils/data_utils.py#L146 (please delete pickle_protocol and cache_dir)
Metatensor can be zero, since we did scale-intensity https://github.com/Luffy03/VoCo/blob/8ccc7a4bc545b5ddbfff26ac8076418aa5ae76c8/Finetune/BTCV/utils/data_utils.py#L80. Less than a_min (like background) will be zero.
thanks a lot ,Thank you for your patient response
No problem, feel free to raise any issues, and thanks a lot for pointing out our bugs.
I‘ve replaced 'PersistentDataset' with 'Dataset',still showing: KeyError: 'image_meta_dict'.
but i do the following:
for idx, batch_data in enumerate(val_loader):
print(f"batch_data keys: {batch_data.keys()}")
showing:
batch_data keys: dict_keys(['image', 'label', 'foreground_start_coord', 'foreground_end_coord'])
There's no 'image_meta_dict' in the result. That's not ture,is it?
Seems it is due to the monai version, 'val.py' is written with the old version of MONAI. I will look into it and fix the bug. The reason is in https://github.com/Luffy03/VoCo/blob/c0b663de47250201daaf08fd3e21c911a69e41d6/Finetune/BTCV/val.py#L124 You can delete this line since we don't need img_name for validation. I believe it will work.
thanks a lot ,it work.I have one more questions:about segmrntation image visualization i use Matplotlib for visualization,like this:
my background is blank, not like the image shown in your paper, the background is real input image,
do you have any suggestions for this?
I merge the image with the label using the Image package, as follows: Maybe it is not the best choice.
Thank you very much.
Dear author, I would like to seek your guidance regarding that : Designing different downstream tasks in Finetune, such as BTCV and MM-WHS, both segmentation tasks, so what is the design difference? Seems to use the same segmentation model, loss function.
Dear author, I would like to seek your guidance regarding that : Designing different downstream tasks in Finetune, such as BTCV and MM-WHS, both segmentation tasks, so what is the design difference? Seems to use the same segmentation model, loss function.
The pre - processing (scale intensity,spacing) can be different. I split them to different projets for flexibility.
Do you have any experience or suggestions on how to set up pre - processing for datasets of different parts?
Good question! we are still working on it.It is really difficult to find the best setting and it is important to the performance.Maybe nnunet is a better solution due to it's data fingerprint setting. Now we set scale intensity[-175, 250] for abdomen and head neck [0,1700] for heart [-500,1000] for chest. for spacing and size it should be depended by specific datadet
Thanks a lot. That would be very helpful!
Dear researchers, our work is now available at Large-Scale-Medical, if you are still interested in this topic. Thank you very much for your attention to our work, it does encourage me a lot!
Hi, thank you for this great work! I would like to ask you some questions about how to reproduce, if I only want to split the BTCV data set, what should I change, and where in the code should I change the data set address to the address I downloaded。