3D-ResNets-PyTorch icon indicating copy to clipboard operation
3D-ResNets-PyTorch copied to clipboard

Directly test custom dataset using pretrained model

Open Fazlik995 opened this issue 4 years ago • 1 comments

Hi!

Can I directly test my custom dataset on pretrianed model?

My console shows below error:

run target_transform; <target_transforms.VideoID object at 0x7f8fd1f57898> dataset loading [0/3783] dataset loading [1000/3783] dataset loading [2000/3783] dataset loading [3000/3783] test /home/fazlik/Desktop/3D-ResNets-PyTorch/test.py:41: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead. inputs = Variable(inputs, volatile=True) /home/fazlik/Desktop/3D-ResNets-PyTorch/test.py:49: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument. outputs = F.softmax(outputs) Traceback (most recent call last): File "main.py", line 181, in test.test(test_loader, model, opt, test_data.class_names) File "/home/fazlik/Desktop/3D-ResNets-PyTorch/test.py", line 54, in test test_results, class_names) File "/home/fazlik/Desktop/3D-ResNets-PyTorch/test.py", line 19, in calculate_video_results 'label': class_names[locs[i].item()], KeyError: 2037

How can I deal with that issue?

Thank you

Fazlik995 avatar May 14 '20 09:05 Fazlik995

Hi, maybe try class_names[locs[i]..cou().item()]

spoorgholi74 avatar May 17 '20 14:05 spoorgholi74