【debug】diffusion 报错 数据集加载问题

发布时间:2024年01月03日
save cfg ... logs/2024-01-02_tst_infrared_2/configs/2024-01-02-project.yaml
Lightning config
find_unused_parameters: false
callbacks:
  image_logger:
    target: main_inpainting.ImageLogger
    params:
      disabled: false
      batch_frequency: 750
      max_images: 4
      increase_log_steps: true
      log_first_step: true
      log_images_kwargs:
        use_ema_scope: false
        plot_progressive_rows: true
        plot_diffusion_rows: true
        'N': 4
        unconditional_guidance_scale: 1.0
        unconditional_guidance_label:
        - ''
        ddim_steps: 50
        ddim_eta: 0.0
trainer:
  accelerator: ddp
  deterministic: true
  gpus: 0,1


  | Name              | Type             | Params
-------------------------------------------------------
0 | model             | DiffusionWrapper | 387 M 
1 | model_ema         | LitEma           | 0     
2 | first_stage_model | VQModelInterface | 53.2 M
-------------------------------------------------------
387 M     Trainable params
53.2 M    Non-trainable params
440 M     Total params
1,761.861 Total estimated model params size (MB)
Validation sanity check: 0it [00:00, ?it/s]Traceback (most recent call last):
  File "main_inpainting.py", line 714, in <module>
    trainer.fit(model, data)
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 553, in fit
    self._run(model)
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 918, in _run
    self._dispatch()
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 986, in _dispatch
    self.accelerator.start_training(self)
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/site-packages/pytorch_lightning/accelerators/accelerator.py", line 92, in start_training
    self.training_type_plugin.start_training(trainer)
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/site-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 161, in start_training
    self._results = trainer.run_stage()
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 996, in run_stage
    return self._run_train()
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1031, in _run_train
    self._run_sanity_check(self.lightning_module)
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1111, in _run_sanity_check
    self._evaluation_loop.reload_evaluation_dataloaders()
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/site-packages/pytorch_lightning/loops/dataloader/evaluation_loop.py", line 173, in reload_evaluation_dataloaders
    self.trainer.reset_val_dataloader(model)
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/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 "/home/spai/anaconda3/envs/sdi/lib/python3.8/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 "/home/spai/anaconda3/envs/sdi/lib/python3.8/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
None
Traceback (most recent call last):
  File "/home/spai/code/Stable-Diffusion-Inpaint-main/main_inpainting.py", line 714, in <module>
    trainer.fit(model, data)
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 553, in fit
    self._run(model)
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 918, in _run
    self._dispatch()
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 986, in _dispatch
    self.accelerator.start_training(self)
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/site-packages/pytorch_lightning/accelerators/accelerator.py", line 92, in start_training
    self.training_type_plugin.start_training(trainer)
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/site-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 161, in start_training
    self._results = trainer.run_stage()
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 996, in run_stage
    return self._run_train()
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1031, in _run_train
    self._run_sanity_check(self.lightning_module)
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1111, in _run_sanity_check
    self._evaluation_loop.reload_evaluation_dataloaders()
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/site-packages/pytorch_lightning/loops/dataloader/evaluation_loop.py", line 173, in reload_evaluation_dataloaders
    self.trainer.reset_val_dataloader(model)
  File "/home/spai/anaconda3/envs/sdi/lib/python3.8/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 "/home/spai/anaconda3/envs/sdi/lib/python3.8/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 "/home/spai/anaconda3/envs/sdi/lib/python3.8/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
None

检查日志:

train, InpaintingTrain, 686
validation, InpaintingValidation, 0
文章来源:https://blog.csdn.net/prinTao/article/details/135346017
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。