Error while running with CUHK03 dataset
Opened this issue · 0 comments
Hi, the same error is happening with Python 2.78 (train or test) or Python 3.76 (train or test) after CUHK03 images are already generated (PyTorch 0.4.1 or PyTorch 1.4.0):
Args:Namespace(D='MSGAN', G_resume_dir='', ablation='', ak_type=-1, attr_dir='', attr_key='upwhite', attr_value=2, beta1=0.5, dataset='cuhk03', epoch=40, eval_freq=1, loss='xent_htri', lr=0.0002, mag_in=16.0, margin=0.3, mode='train', normalization='bn', num_ker=32, pre_dir='models', print_freq=20, root='data', save_dir='logs', seed=123, targetmodel='aligned', temperature=-1.0, test_batch=32, train_batch=32, use_SSIM=2, usegumbel=False, usevis=False, vis_dir='vis')
GPU mode Initializing dataset cuhk03 Note: if root path is changed, the previously generated json files need to be re-generated (delete them first) Split index = 0 => CUHK03 (detected) loaded Dataset statistics: subset | # ids | # images train | 767 | 7365 query | 700 | 1400 gallery | 700 | 5332 total | 1467 | 8765 Initializing model: aligned Model size: 14.86019M ==> Start training
Traceback (most recent call last): File "train.py", line 416, in <module> main(opt) File "train.py", line 160, in main train(epoch, G, D, target_net, criterionGAN, clf_criterion, metric_criterion, optimizer_G, optimizer_D, trainloader, use_gpu) File "train.py", line 194, in train for batch_idx, (imgs, pids, _, pids_raw) in enumerate(trainloader): File "/home/eduardoandrade/anaconda3/envs/adversarial_attack_on_person_reid_with_deep_mis_ranking_python_2_env/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 336, in __next__ return self._process_next_batch(batch) File "/home/eduardoandrade/anaconda3/envs/adversarial_attack_on_person_reid_with_deep_mis_ranking_python_2_env/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 357, in _process_next_batch raise batch.exc_type(batch.exc_msg) TypeError: Traceback (most recent call last): File "/home/eduardoandrade/anaconda3/envs/adversarial_attack_on_person_reid_with_deep_mis_ranking_python_2_env/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 106, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File "/home/eduardoandrade/anaconda3/envs/adversarial_attack_on_person_reid_with_deep_mis_ranking_python_2_env/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 187, in default_collate return [default_collate(samples) for samples in transposed] File "/home/eduardoandrade/anaconda3/envs/adversarial_attack_on_person_reid_with_deep_mis_ranking_python_2_env/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 189, in default_collate raise TypeError((error_msg.format(type(batch[0])))) TypeError: batch must contain tensors, numbers, dicts or lists; found <type 'NoneType'>
Don't know why it is returning 'NoneType'.