lin-tianyu / Stable-Diffusion-Seg

[MICCAI 2024] Codebase for "Stable Diffusion Segmentation for Biomedical Images with Single-step Reverse Process"
https://lin-tianyu.github.io/Stable-Diffusion-Seg/
Other
65 stars 6 forks source link

为什么kseg数据集这个是pass #5

Closed 1234xcs closed 4 months ago

1234xcs commented 4 months ago

cea4095cad787b7148e8f0415b46db8

lin-tianyu commented 4 months ago

我在最新的commit 8cea5991e330923a32ef0218136c05f78c9d6996 中更新了这部分代码。

1234xcs commented 4 months ago

还有一个问题 当我更换数据集为CVC-ClinicDB时 为啥会显示以下错误 是我的数据集目录或者命名有问题吗 Traceback (most recent call last): File "main.py", line 816, in trainer.fit(model, data) File "D:\py\Anaconda3\envs\sdseg\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 553, in fit self._run(model) File "D:\py\Anaconda3\envs\sdseg\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 918, in _run self._dispatch() File "D:\py\Anaconda3\envs\sdseg\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 986, in _dispatch self.accelerator.start_training(self) File "D:\py\Anaconda3\envs\sdseg\lib\site-packages\pytorch_lightning\accelerators\accelerator.py", line 92, in start_training self.training_type_plugin.start_training(trainer) File "D:\py\Anaconda3\envs\sdseg\lib\site-packages\pytorch_lightning\plugins\training_type\training_type_plugin.py", line 161, in start_training self._results = trainer.run_stage() File "D:\py\Anaconda3\envs\sdseg\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 996, in run_stage return self._run_train() File "D:\py\Anaconda3\envs\sdseg\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 1031, in _run_train self._run_sanity_check(self.lightning_module) File "D:\py\Anaconda3\envs\sdseg\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 1111, in _run_sanity_check self._evaluation_loop.reload_evaluation_dataloaders() File "D:\py\Anaconda3\envs\sdseg\lib\site-packages\pytorch_lightning\loops\dataloader\evaluation_loop.py", line 173, in reload_evaluation_dataloaders self.trainer.reset_val_dataloader(model) File "D:\py\Anaconda3\envs\sdseg\lib\site-packages\pytorch_lightning\trainer\data_loading.py", line 437, in reset_val_dataloader self.num_val_batches, self.val_dataloaders = self._reset_eval_dataloader(model, "val") File "D:\py\Anaconda3\envs\sdseg\lib\site-packages\pytorch_lightning\trainer\data_loading.py", line 398, in _reset_eval_dataloader num_batches = len(dataloader) if has_len(dataloader) else float("inf") File "D:\py\Anaconda3\envs\sdseg\lib\site-packages\pytorch_lightning\utilities\data.py", line 63, in has_len raise ValueError("Dataloader returned 0 length. Please make sure that it returns at least 1 batch") ValueError: Dataloader returned 0 length. Please make sure that it returns at least 1 batch

lin-tianyu commented 4 months ago

我猜测应该是目录问题,请对照ldm/data/cvc.py文件末尾中的数据集路径进行检查。