medicaldiffusion icon indicating copy to clipboard operation
medicaldiffusion copied to clipboard

LexerNoViableAltException: 2020 & import ddpm error

Open ytwas opened this issue 2 years ago • 8 comments

thanks for sharing this awesome work! But I cannot run the code, due to some errors. when I use the provided command to train vqgan: PL_TORCH_DISTRIBUTED_BACKEND=gloo python train/train_vqgan.py dataset=brats dataset.root_dir=../data/BraTS/BraTS 2020 model=vq_gan_3d model.gpus=1 model.default_root_dir_postfix='flair' model.precision=16 model.embedding_dim=8 model.n_hiddens=16 model.num_workers=32 model.gradient_clip_val=1.0 model.lr=3e-4 model.discriminator_iter_start=10000 model.perceptual_weight=4 model.image_gan_weight=1 model.video_gan_weight=1 model.gan_feat_weight=4 model.batch_size=2 model.n_codes=16384 model.accumulate_grad_batches=1

The error information:

Traceback (most recent call last): File "train/train_vqgan.py", line 8, in from ddpm.diffusion import default ModuleNotFoundError: No module named 'ddpm'


Then I try to use export PYTHONPATH=$PYTHONPATH:~/gitcode/medicaldiffusion/ddpm to fix it, but a new error come up:

LexerNoViableAltException: 2020 ^ See https://hydra.cc/docs/next/advanced/override_grammar/basic for details Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.


Thanks in advance!

ytwas avatar Mar 13 '23 14:03 ytwas

I fix the problem, the terminal misunderstand the path../data/BraTS/BraTS 2020 , I change it to '../data/BraTS/BraTS_2020`

ytwas avatar Mar 14 '23 02:03 ytwas

hi, the problem still exist. I cloned the recent code and yet saying no ddpm.

sulaimanvesal avatar Mar 15 '23 18:03 sulaimanvesal

我解决了问题,终端误解了路径../data/BraTS/BraTS 2020 ,我把它改成../data/BraTS/BraTS_2020 '

thanks you for sharing your experience.Could you share your data directory.I would be very thankful.

lihao9056 avatar Mar 16 '23 00:03 lihao9056

thanks you for sharing your experience.Could you share your data directory.I would be very thankful.

我把数据放到了和克隆的代码“medicaldiffusion”这个文件夹同一级的目录下, 目录就像我用的参数一样,只是BraTS 2020没法在终端里使用,因为空格会被识别成分隔下一个参数,所以把空格替换成了下划线

ytwas avatar Mar 16 '23 03:03 ytwas

hi, the problem still exist. I cloned the recent code and yet saying no ddpm.

I failed to run the code, either. Maybe you can try the command export PYTHONPATH=$PYTHONPATH:<PATH TO ddpm> in terminal, and then run the trainning I still have other problem about 'hydra' library

ytwas avatar Mar 16 '23 03:03 ytwas

thank you very much for your reply.

lihao9056 avatar Mar 16 '23 08:03 lihao9056

thanks you for sharing your experience.Could you share your data directory.I would be very thankful.

我把数据放到了和克隆的代码“medicaldiffusion”这个文件夹同一级的目录下, 目录就像我用的参数一样,只是BraTS 2020没法在终端里使用,因为空格会被识别成分隔下一个参数,所以把空格替换成了下划线

@ytwas 您好,请问您复现了这个代码了么?我在实现这个代码加载数据集的时候,每次都会报错,说数据集不可用。可以确定的是我的数据集名字是没有空格的。

Zhongrocky avatar May 06 '23 02:05 Zhongrocky

I have experienced the same problem. Can you help me?

yunfei920406 avatar Nov 18 '23 13:11 yunfei920406