Open robocarpoli opened 1 year ago
i had this same error IsADirectoryError i fixed it by giving absolute paths to the model and ddim folders
Thank you, i updated the parameters with absolute paths but no change.
python main.py --base /home/ubuntu/Dreambooth-Stable-Diffusion/configs/stable-diffusion/v1-finetune_unfrozen.yaml -t --actual_resume /home/ubuntu/Dreambooth-Stable-Diffusion/sd-v1-4.ckpt -n project01 --gpus 0, --data_root /home/ubuntu/input --reg_data_root /home/ubuntu/Dreambooth-Stable-Diffusion/outputs/txt2img-samples/samples1 --class_word titus
IsADirectoryError: [Errno 21] Is a directory: '/home/ubuntu/Dreambooth-Stable-Diffusion/outputs/txt2img-samples/samples1/.ipynb_checkpoints'
Seems weird that you are passing .ipynb_checkpoints
as sample data to fit your model
.ipynb_checkpoint
is used by Jupyter to store it's checkpoint (used for the Revert to Checkpoint button).
Maybe your folder /home/ubuntu/Dreambooth-Stable-Diffusion/outputs/txt2img-samples/samples1
contain unwanted hidding files and folders.
Thanks, that folder was indeed the culprit.
ls -a revealed the folder, and rm - r removed it.
I'm running into the same problem with my regularization root. I checked that there are no hidden directories in there.
python main.py --base configs/stable-diffusion/v1-finetune_unfrozen.yaml \
-t \
--num_workers 16 \
--actual_resume /home/ekurutepe/ml/checkpoints/v1-5-pruned.ckpt \
-n "train-dog" \
--gpus 0, \
--data_root /home/ekurutepe/ml/training-data/animals/dog \
--reg_data_root /home/ekurutepe/ml/training-data/animals/dog/regularization \
--class_word dog \
gives me:
Validation sanity check: 0%| | 0/2 [00:00<?, ?it/s]Summoning checkpoint.
Traceback (most recent call last):
File "main.py", line 830, in <module>
trainer.fit(model, data)
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 740, in fit
self._call_and_handle_interrupt(
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 685, in _call_and_handle_interrupt
return trainer_fn(*args, **kwargs)
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 777, in _fit_impl
self._run(model, ckpt_path=ckpt_path)
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1199, in _run
self._dispatch()
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1279, in _dispatch
self.training_type_plugin.start_training(self)
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 202, in start_training
self._results = trainer.run_stage()
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1289, in run_stage
return self._run_train()
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1311, in _run_train
self._run_sanity_check(self.lightning_module)
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1375, in _run_sanity_check
self._evaluation_loop.run()
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/pytorch_lightning/loops/base.py", line 145, in run
self.advance(*args, **kwargs)
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/pytorch_lightning/loops/dataloader/evaluation_loop.py", line 110, in advance
dl_outputs = self.epoch_loop.run(dataloader, dataloader_idx, dl_max_batches, self.num_dataloaders)
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/pytorch_lightning/loops/base.py", line 140, in run
self.on_run_start(*args, **kwargs)
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/pytorch_lightning/loops/epoch/evaluation_epoch_loop.py", line 86, in on_run_start
self._dataloader_iter = _update_dataloader_iter(data_fetcher, self.batch_progress.current.ready)
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/pytorch_lightning/loops/utilities.py", line 121, in _update_dataloader_iter
dataloader_iter = enumerate(data_fetcher, batch_idx)
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/pytorch_lightning/utilities/fetching.py", line 199, in __iter__
self.prefetching(self.prefetch_batches)
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/pytorch_lightning/utilities/fetching.py", line 258, in prefetching
self._fetch_next_batch()
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/pytorch_lightning/utilities/fetching.py", line 300, in _fetch_next_batch
batch = next(self.dataloader_iter)
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in __next__
data = self._next_data()
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data
return self._process_data(data)
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data
data.reraise()
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/torch/_utils.py", line 434, in reraise
raise exception
IsADirectoryError: Caught IsADirectoryError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/ekurutepe/ml/Dreambooth-Stable-Diffusion/ldm/data/personalized.py", line 188, in __getitem__
image = Image.open(self.image_paths[i % self.num_images])
File "/home/ekurutepe/miniconda3/envs/ti/lib/python3.8/site-packages/PIL/Image.py", line 2953, in open
fp = builtins.open(filename, "rb")
IsADirectoryError: [Errno 21] Is a directory: '/home/ekurutepe/ml/training-data/animals/dog/regularization'
/home/ekurutepe/ml/training-data/animals/dog/regularization
is a directory containing 100 images from 00008.jpg
to 00107.jpg
. No hidden files or hidden directories.
oops. I figured it out. Because my reg_data directory was inside the training data directory. I moved it out to the parent directory and now it works. Leaving this here in case it helps somebody in the future.
Thanks for the great work!
python main.py --base configs/stable-diffusion/v1-finetune_unfrozen.yaml -t --actual_resume ~/Dreambooth-Stable-Diffusion/sd-v1-4.ckpt -n project01 --gpus 0, --data_root ~/input --reg_data_root ~/Dreambooth-Stable-Diffusion/outputs/txt2img-samples/samples --class_word titus
""" Epoch 0: 45%|███████████████████████▉ | 137/303 [02:04<02:30, 1.10it/s, loss=0.412, v_num=0, train/loss_simple_step=0.783, train/loss_vlb_step=0.0191, train/loss_step=0.783, global_step=136.0]Summoning checkpoint.
Traceback (most recent call last): File "main.py", line 830, in
trainer.fit(model, data)
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 740, in fit
self._call_and_handle_interrupt(
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 685, in _call_and_handle_interrupt
return trainer_fn(*args, kwargs)
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 777, in _fit_impl
self._run(model, ckpt_path=ckpt_path)
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1199, in _run
self._dispatch()
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1279, in _dispatch
self.training_type_plugin.start_training(self)
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 202, in start_training
self._results = trainer.run_stage()
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1289, in run_stage
return self._run_train()
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1319, in _run_train
self.fit_loop.run()
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/pytorch_lightning/loops/base.py", line 145, in run
self.advance(*args, *kwargs)
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/pytorch_lightning/loops/fit_loop.py", line 234, in advance
self.epoch_loop.run(data_fetcher)
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/pytorch_lightning/loops/base.py", line 145, in run
self.advance(args, kwargs)
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/pytorch_lightning/loops/epoch/training_epoch_loop.py", line 156, in advance
batch_idx, (batch, self.batch_progress.is_last_batch) = next(self._dataloader_iter)
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/pytorch_lightning/utilities/fetching.py", line 203, in next
return self.fetching_function()
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/pytorch_lightning/utilities/fetching.py", line 270, in fetching_function
self._fetch_next_batch()
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/pytorch_lightning/utilities/fetching.py", line 300, in _fetch_next_batch
batch = next(self.dataloader_iter)
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/pytorch_lightning/trainer/supporters.py", line 550, in next
return self.request_next_batch(self.loader_iters)
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/pytorch_lightning/trainer/supporters.py", line 562, in request_next_batch
return apply_to_collection(loader_iters, Iterator, next)
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/pytorch_lightning/utilities/apply_func.py", line 95, in apply_to_collection
return function(data, *args, **kwargs)
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in next
data = self._next_data()
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data
return self._process_data(data)
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data
data.reraise()
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/_utils.py", line 434, in reraise
raise exception
IsADirectoryError: Caught IsADirectoryError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/ubuntu/Dreambooth-Stable-Diffusion/main.py", line 221, in getitem
return tuple(d[idx] for d in self.datasets)
File "/home/ubuntu/Dreambooth-Stable-Diffusion/main.py", line 221, in
return tuple(d[idx] for d in self.datasets)
File "/home/ubuntu/Dreambooth-Stable-Diffusion/ldm/data/personalized.py", line 188, in getitem
image = Image.open(self.image_paths[i % self.num_images])
File "/home/ubuntu/anaconda3/envs/ldm/lib/python3.8/site-packages/PIL/Image.py", line 2953, in open
fp = builtins.open(filename, "rb")
IsADirectoryError: [Errno 21] Is a directory: '/home/ubuntu/Dreambooth-Stable-Diffusion/outputs/txt2img-samples/samples/.ipynb_checkpoints'
"""