Skip to content

RuntimeError: CUDA error: invalid argument #10

@Morgansgun

Description

@Morgansgun

when I run the code,the error came:

File "referit3d/models/referit3d_net_utils.py", line 206, in detailed_predictions_on_dataset
batch[k] = batch[k].to(device)
RuntimeError: CUDA error: invalid argument

the orignal code for this part is :
def detailed_predictions_on_dataset(model, data_loader, args, device, FOR_VISUALIZATION=True,tokenizer=None):
model.eval()

res = dict()
res['guessed_correctly'] = list()
res['confidences_probs'] = list()
res['contrasted_objects'] = list()
res['target_pos'] = list()
res['context_size'] = list()
res['guessed_correctly_among_true_class'] = list()

batch_keys = make_batch_keys(args, extras=['context_size', 'target_class_mask'])

if FOR_VISUALIZATION:
    res['utterance'] = list()
    res['stimulus_id'] = list()
    res['object_ids'] = list()
    res['target_object_id'] = list()
    res['distrators_pos'] = list()

for batch in tqdm.tqdm(data_loader):
    # Move data to gpu
    for k in batch_keys:
        if isinstance(batch[k],list):
            continue
        batch[k] = batch[k].to(device)

I think something wrong with the "k" in the batch[k],but I don't know how to fix it, can anybody help me ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions