Skip to content
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

Question on ADNI #5

Open
EmreTaha opened this issue Mar 3, 2025 · 3 comments
Open

Question on ADNI #5

EmreTaha opened this issue Mar 3, 2025 · 3 comments

Comments

@EmreTaha
Copy link

EmreTaha commented Mar 3, 2025

Hi, thanks for the nice work and detailed pipeline. I have couple of questions on the ADNI, It would be much appreciated if you can clarify.
I created a csv file for ADNI phases based on your flow chart. For T1w scans from ADNI, did you use any scan other than mprage? Also apparently, ADNI doesnt support downloading nifti version of the raw scans, only 2D cross sectional dicoms (https://groups.google.com/g/adni-data/c/Rs9NE8R4mDg), which tool did you use for converting dicom to nifti (I assume a conversion is applied since the preprocessing requires nifti)?
Thanks in advance!

@LemuelPuglisi
Copy link
Owner

Hi!

Regarding ADNI, I’ve only used MPRAGE images.

About the conversion to nifti, you can use dcm2niix: https://github.com/rordenlab/dcm2niix

Best regards,
Lemuel

@JornyWan
Copy link

JornyWan commented Mar 3, 2025

hi, I have processed ADNI dataset and tried to train the LDM based on pretrained Autoencoder, but the training got loss=nan and the generated images from image_to_tensorboard are noise while I didn't make any change of the [train_diffusion_unet.py] as well as other files. I'd really appreciate it if this could be solved, thanks for your great work!

@JornyWan
Copy link

JornyWan commented Mar 3, 2025

FYI, i added the weights_only to False in torch because the original training code returns error as the following:

Traceback (most recent call last):
File "/BrLP/scripts/training/train_diffusion_unet.py", line 152, in
z = trainset[0]['latent']
File "/.conda/envs/brlp/lib/python3.9/site-packages/monai/data/dataset.py", line 112, in getitem
return self._transform(index)
File "/.conda/envs/brlp/lib/python3.9/site-packages/monai/data/dataset.py", line 424, in _transform
pre_random_item = self._cachecheck(self.data[index])
File "/.conda/envs/brlp/lib/python3.9/site-packages/monai/data/dataset.py", line 386, in _cachecheck
return torch.load(hashfile)
File "/.conda/envs/brlp/lib/python3.9/site-packages/torch/serialization.py", line 1470, in load
raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
_pickle.UnpicklingError: Weights only load failed. This file can still be loaded, to do so you have two options, �[1mdo those steps only if you trust the source of the checkpoint�[0m.
(1) In PyTorch 2.6, we changed the default value of the weights_only argument in torch.load from False to True. Re-running torch.load with weights_only set to False will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.
(2) Alternatively, to load with weights_only=True please check the recommended steps in the following error message.
WeightsUnpickler error: Unsupported global: GLOBAL monai.data.meta_tensor.MetaTensor was not an allowed global by default. Please use torch.serialization.add_safe_globals([MetaTensor]) or the torch.serialization.safe_globals([MetaTensor]) context manager to allowlist this global if you trust this class/function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants