lama icon indicating copy to clipboard operation
lama copied to clipboard

Error occurred while training with my own dataset

Open ShiChengxin-0810 opened this issue 3 months ago • 2 comments

Image My configuration file is as above. Following the approach of a friend in the issue, I wanted to start training from a pre trained model, but encountered an issue with loading data, which showed: [2025-10-25 09:27:54,147][saicinpainting.training.data.datasets][INFO] - Make val dataloader default from /root/lama/data//val [2025-10-25 09:27:54,150][saicinpainting.training.data.datasets][INFO] - Make val dataloader default from /root/lama/data//visual_test [2025-10-25 09:27:54,152][__main__][CRITICAL] - Training failed due to `Dataloader` returned 0 length. Please make sure that it returns at least 1 batch: Traceback (most recent call last): File "bin/train.py", line 64, in main trainer.fit(training_model) File "/root/miniconda3/envs/lama/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 499, in fit self.dispatch() File "/root/miniconda3/envs/lama/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 546, in dispatch self.accelerator.start_training(self) File "/root/miniconda3/envs/lama/lib/python3.6/site-packages/pytorch_lightning/accelerators/accelerator.py", line 73, in start_training self.training_type_plugin.start_training(trainer) File "/root/miniconda3/envs/lama/lib/python3.6/site-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 114, in start_training self._results = trainer.run_train() File "/root/miniconda3/envs/lama/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 607, in run_train self.run_sanity_check(self.lightning_module) File "/root/miniconda3/envs/lama/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 854, in run_sanity_check self.reset_val_dataloader(ref_model) File "/root/miniconda3/envs/lama/lib/python3.6/site-packages/pytorch_lightning/trainer/data_loading.py", line 364, in reset_val_dataloader self.num_val_batches, self.val_dataloaders = self._reset_eval_dataloader(model, 'val') File "/root/miniconda3/envs/lama/lib/python3.6/site-packages/pytorch_lightning/trainer/data_loading.py", line 325, in _reset_eval_dataloader num_batches = len(dataloader) if has_len(dataloader) else float('inf') File "/root/miniconda3/envs/lama/lib/python3.6/site-packages/pytorch_lightning/utilities/data.py", line 33, 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 I have placed the images and masks used for training and testing in the same folder/lama/data/val (image1.jpg, image1_mask001. jpg...). The problem still persists and I look forward to resolving it. Thank you.

ShiChengxin-0810 avatar Oct 25 '25 01:10 ShiChengxin-0810

Hey @ShiChengxin-0810, did you actually rectify the error and train your model? I also got stuck while training.

ankit-21310 avatar Nov 06 '25 11:11 ankit-21310

No,I just give up. I don't think it will work.

David @.***

     原始邮件
     
   

发件人:Ankit kumar singh @.> 发件时间:2025年11月6日 19:17 收件人:advimman/lama @.> 抄送:ShiChengxin-0810 @.>, Mention @.> 主题:Re: [advimman/lama] Error occurred while training with my own dataset(Issue #359)

ankit-21310 left a comment (advimman/lama#359)

Hey @ShiChengxin-0810, did you actually rectify the error and train your model? I also got stuck while training.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

ShiChengxin-0810 avatar Nov 06 '25 11:11 ShiChengxin-0810