京东fast-reid运行visualize_result.py出现error:IndexError: invalid index to scalar variable
程序员文章站
2023-11-01 13:54:10
1.问题IndexError: invalid index to scalar variable2.解决修改/fast-reid-master/fastreid/evaluation/rank.pyline182:def evaluate_rank( distmat, q_pids, g_pids, q_camids, g_camids, max_rank=50, use_...
1.问题
IndexError: invalid index to scalar variable
2.解决
修改/fast-reid-master/fastreid/evaluation/rank.py
line182:
def evaluate_rank(
distmat,
q_pids,
g_pids,
q_camids,
g_camids,
max_rank=50,
use_metric_cuhk03=False,
use_cython=True
):
改为:
def evaluate_rank(
distmat,
q_pids,
g_pids,
q_camids,
g_camids,
max_rank=50,
use_metric_cuhk03=False,
use_cython=False
):
更靠谱的修改fast-reid-master/fastreid/utils/visualizer.py line72附近:
if len(query_indices) != 1:
ax.set_title('{}/{:.2f}/cam{}'.format(query_name, self.all_ap[q_idx], cam_id))
else:
ax.set_title('{}/{:.2f}/cam{}'.format(query_name, self.all_ap, cam_id))
运行下面命令之后:
python ./demo/visualize_result.py --config-file './configs/Market1501/AGW_R50.yml' --vis-label --dataset-name 'Market1501' --output 'logs/market1501/agw_R50/agw_market1501_vis' --opts MODEL.WEIGHTS "./logs/market1501/agw_R50/model_final.pth"
参考
1.fast-reid/issues/105(my issue)
本文地址:https://blog.csdn.net/qq_35975447/article/details/107313764
上一篇: 浅析企业在网站建设阶段如何做好差异化