当前位置:   article > 正文

TypeError: only integer scalar arrays can be converted to a scalar index_只有单个元素的整数张量才能转换为索引

只有单个元素的整数张量才能转换为索引

解决思路

类型错误:只有整数标量数组才能转换为标量索引。

这应该是最新版本的python、numpy的问题。版本升级,有些方法已经发生改变,使将单个元素数组作为标量进行索引成为一个错误。

解决步骤

原来

q_pid = np.array(q_pids)[q_idx]
        q_camid = q_camids[q_idx]

        # remove gallery samples that have the same pid and camid with query
        order = indices
  • 1
  • 2
  • 3
  • 4
声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号