feat_pool, feat_fc = net(input, input, test_mode[1])
ValueError: too many values to unpack (expected 2)
with torch.no_grad():
for batch_idx, (input, label ) in enumerate(query_loader):
batch_num = input.size(0)
input = Variable(input.cuda())
feat_pool, feat_fc = net(input, input, test_mode[1])
query_feat_pool[ptr:ptr+batch_num,: ] = feat_pool.detach().cpu().numpy()
query_feat_fc[ptr:ptr+batch_num,: ] = feat_fc.detach().cpu().numpy()
ptr = ptr + batch_num
print('Extracting Time:\t {:.3f}'.format(time.time()-start))
return query_feat_pool, query_feat_fc
其中query_loader = data.DataLoader(queryset, batch_size=args.test_batch, shuffle=False, num_workers=0)
Traceback (most recent call last):
File "E:/韩志忠学习/海军21code/DGTL-for-VT-ReID-main/test.py", line 266, in
query_feat_pool, query_feat_fc = extract_query_feat(query_loader)
File "E:/韩志忠学习/海军21code/DGTL-for-VT-ReID-main/test.py", line 156, in extract_query_feat
feat_pool, feat_fc = net(input, input, test_mode[1])
ValueError: too many values to unpack (expected 2)