Training with Visual Genome
pqviet opened this issue · comments
When trying to train with the train/val splits and Visual Genome
python main.py --config config/butd_vqa.json --seed 1 --use_both --use_vg
I got this error
nParams= 41192896
optim: adamax lr=0.0010, decay_step=2, decay_rate=0.25,grad_clip=0.25
LR decay epochs: 15,17,19
gradual warmup lr: 0.0005
Traceback (most recent call last):
File "main.py", line 289, in
train(model, train_loader, eval_loader, args, device)
File "train.py", line 91, in train
sem_adj_matrix) in enumerate(train_loader):
File "python3.7/site-packages/torch/utils/data/dataloader.py", line 637, in next
return self._process_next_batch(batch)
File "python3.7/site-packages/torch/utils/data/dataloader.py", line 658, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
TypeError: Traceback (most recent call last):
File "python3.7/site-packages/torch/utils/data/dataloader.py", line 138, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "utils.py", line 172, in trim_collate
return [trim_collate(samples) for samples in transposed]
File "utils.py", line 172, in
return [trim_collate(samples) for samples in transposed]
File "utils.py", line 161, in trim_collate
return torch.LongTensor(batch)
TypeError: an integer is required (got type str)
I think the problem is in the process of encoding Genome questions. Do you have any ideas?
Sorry for the late reply. Are you still facing the same issue? I don't see similar error when training with Visual Genome.
The problem remains unsolved for me
I suspect is the question id. But to further debug, you can set the num_workers in data loader to 0 and use ipdb. Let me know if it helps.
Closing this due to no further activities.