GaitSet
GaitSet copied to clipboard
运行train.py 总是会有这样的错误,不知道该怎么解决?
D:\Python_Demo\GaitSet-master\model\network\triplet.py:22: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead. (Triggered internally at ..\aten\src\ATen/native/IndexingUtils.h:20.)
hard_hp_dist = torch.max(torch.masked_select(dist, hp_mask).view(n, m, -1), 2)[0]
D:\Python_Demo\GaitSet-master\model\network\triplet.py:23: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead. (Triggered internally at ..\aten\src\ATen/native/IndexingUtils.h:20.)
hard_hn_dist = torch.min(torch.masked_select(dist, hn_mask).view(n, m, -1), 2)[0]
Traceback (most recent call last):
File "D:/Python_Demo/GaitSet-master/train.py", line 21, in
Process finished with exit code 1
The same problem. Fixed it by changing every
hp_mask = (label.unsqueeze(1) == label.unsqueeze(2)).byte().view(-1)
hn_mask = (label.unsqueeze(1) != label.unsqueeze(2)).byte().view(-1)
to
hp_mask = (label.unsqueeze(1) == label.unsqueeze(2)).bool().view(-1)
hn_mask = (label.unsqueeze(1) != label.unsqueeze(2)).bool().view(-1)
in files: model\network\triplet.py
it caused by version conflict of pytorch
But it remains an error: "hard_hn_dist = torch.min(torch.masked_select(dist, hn_mask).view(n, m, -1), 2)[0] RuntimeError: cannot perform reduction function min on tensor with no elements because the operation does not have an identity
Process finished with exit code 1" How do you fix it?