ValueError: too many values to unpack (expected 2)

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)

eat_pool, feat_fc = net(input, input, test_mode[1])这段话的
net函数的返回值给多了,看下net的return几个变量

应该是这个函数只需要两个参数,你给了三个

仔细看看net的返回值到底是几个,我看你net的代码怎么有时候返回1个值有时候返回4个值,这是要闹哪样
如果你返回值的个数不固定,那你接收返回值的时候应该用一个元组来接,而不是用2个变量来接,那只返回1个值或者返回3个值都会报错