Skip to content

inconsistent results in sequential inference #35

@l1346792580123

Description

@l1346792580123

Thanks for sharing such great work! I have found that the results of multiple inferences on the same image were inconsistent. When I inference this image alone the result is empty. While when I inference another image first and then inference this image, the result is not empty. The example code as follows:

import torch
import torchvision

model = torch.jit.load('nlf_l_multi_0.3.2.torchscript').cuda().eval()

image = torchvision.io.read_image('img1.jpg').cuda()
frame_batch = image.unsqueeze(0)

image2 = torchvision.io.read_image('img2.jpg').cuda()
frame_batch2 = image2.unsqueeze(0)

with torch.inference_mode(), torch.device('cuda'):
    pred = model.detect_smpl_batched(frame_batch)
    print(pred['pose'])


    pred2 = model.detect_smpl_batched(frame_batch2)
    print(pred2['pose'])


    pred3 = model.detect_smpl_batched(frame_batch)
    print(pred3['pose'])

the code and image can be found here test.zip. Is this a bug?

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