-
Notifications
You must be signed in to change notification settings - Fork 12
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
extract.py报错 #31
Comments
help!help! |
解决了吗? 救命! |
我是这么修改的,不知道对不对
|
tsne.py可视化里的代码怎么改呀,救救 |
运行extract.py报错
Traceback (most recent call last):
File "/home/hzh/Github/LLCM-main/DEEN/extract.py", line 268, in
query_feat_pool, query_feat_fc = extract_query_feat(query_loader)
File "/home/hzh/Github/LLCM-main/DEEN/extract.py", line 138, in extract_query_feat
query_feat_pool[ptr:ptr + batch_num, :] = feat_pool.detach().cpu().numpy()
ValueError: could not broadcast input array from shape (192,2048) into shape (64,2048)
把通道维度连接成一个特征,但是可视化的图不对,请问可以给出符合DEEN的extract.py详细代码吗?
def extract_query_feat(query_loader):
net.eval()
print('Extracting Query Feature...')
start = time.time()
ptr = 0
query_feat_pool = np.zeros((nquery, pool_dim * 3))
query_feat_fc = np.zeros((nquery, pool_dim * 3))
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, label, test_mode[1]) # [192, 2048], [192, 2048]
The text was updated successfully, but these errors were encountered: