Skip to content

in eval.py RuntimeError: legacy constructor expects device type: cpu but device type: cuda was passed #102

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

Open
kwonseungchan opened this issue Jun 20, 2024 · 1 comment

Comments

@kwonseungchan
Copy link

channge the code in utils.py 235 line

original_ind = torch.LongTensor(range(true_class_boxes.size(0)), device='cuda')[true_class_images == this_image][ind]
==>
original_ind = torch.tensor(range(true_class_boxes.size(0)), dtype=torch.long, device='cuda')[true_class_images == this_image][ind]

@Chadster766
Copy link

This change is required for eval.py to not error.

I would be good to have in Utils.py > calculate_mAP():
for c in tqdm(range(1, n_classes), 'Calculating mAP'):

To have a progress bar for this since it takes a while and I initially though it was a hung process.

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