原始仓库:https://github.com/jongdory/ALDM/tree/main
1. 准备数据集
2. 训练VQ-GAN以及SPADE
首先训练VQ-GAN,将config中的ch从128降维32(由于显存过小)。
CUDA_VISIBLE_DEVICES=0,1 python main.py -b configs/brats_vqgan_stage1.yaml -t True --gpus 0,
3. 训练LDM
Bugs
Bugs.MONAI库读取没有metadata的nii.gz文件的时候报错:metadata not available and channel_dim=None, LoadImaged
MONAI库读取没有metadata的nii.gz文件的时候报错:metadata not available and channel_dim=None, LoadImaged。。。
原因是nii文件里有meta(用itk-snap看是有的),但是读取有问题?
查到项目的isuuse里有答复:
LoadImaged(keys=["image", "label"]),
EnsureChannelFirstd(keys=["image", "label"], strict_check=False, channel_dim='no_channel'),
这样就可以不报错了