FirasGit / medicaldiffusion

Medical Diffusion: This repository contains the code to our paper Medical Diffusion: Denoising Diffusion Probabilistic Models for 3D Medical Image Synthesis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LexerNoViableAltException: 2020 & import ddpm error

ytwas opened this issue · comments

commented

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!

commented

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

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

我解决了问题,终端误解了路径../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.

commented

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

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

commented

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

thank you very much for your reply.

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

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

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

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