Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: not enough values to unpack (expected 2, got 0) #39

Open
S-researcher opened this issue Mar 5, 2024 · 1 comment
Open

Comments

@S-researcher
Copy link

I used rtx3080ti cuda11.1, python==3.8, and the others were configured according to the environment given by the author, but I encountered problems during training

Load deepfake dataset from ./train_images..
Target RGB shape: ()
Target RGB shape: (480, 712, 3)
Target RGB shape: ()
Traceback (most recent call last):
File "train.py", line 151, in
train()
File "train.py", line 112, in train
for index, (batch_data, batch_labels) in enumerate(train_loader):
File "/home/lab/anaconda3/envs/DeepfakeBench/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 517, in next
data = self._next_data()
File "/home/lab/anaconda3/envs/DeepfakeBench/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1199, in _next_data
return self._process_data(data)
File "/home/lab/anaconda3/envs/DeepfakeBench/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1225, in _process_data
data.reraise()
File "/home/lab/anaconda3/envs/DeepfakeBench/lib/python3.8/site-packages/torch/_utils.py", line 429, in reraise
raise self.exc_type(msg)
ValueError: Caught ValueError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/lab/anaconda3/envs/DeepfakeBench/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 202, in _worker_loop
data = fetcher.fetch(index)
File "/home/lab/anaconda3/envs/DeepfakeBench/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/lab/anaconda3/envs/DeepfakeBench/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/lab/tSun/CADDM-master/dataset.py", line 81, in getitem
img, label_dict = prepare_train_input(
File "/home/lab/tSun/CADDM-master/lib/data_preprocess/preprocess.py", line 92, in prepare_train_input
mfs_result, bbox = multi_scale_facial_swap(
File "/home/lab/tSun/CADDM-master/lib/data_preprocess/mfs.py", line 130, in multi_scale_facial_swap
h, w = targetRgb.shape[:2]
ValueError: not enough values to unpack (expected 2, got 0)

I think it is caused by some images being empty when loading images, but I don't know how to solve it.

@Nku-cs-dsc
Copy link
Collaborator

You can traverse your dataset and filter out the source image without the corresponding target image before loading the training set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants