Skip to content

IndexError:Dimension out of range(excepted to be in range of [-1,0],but got 1) #75

@aiqiangbrave

Description

@aiqiangbrave

Hello,can you help me ?thank you! When I use Market data set ,report an error:

problem:
/home/waq/anaconda3/envs/re_person/bin/python /home/waq/Downloads/ai/re_person/code/DG-Net/DG-Net-master/test_2label.py
-------test-----------
/home/waq/Downloads/ai/re_person/code/DG-Net/DG-Net-master/test_2label.py:182: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
config = yaml.load(stream)
Traceback (most recent call last):
File "/home/waq/Downloads/ai/re_person/code/DG-Net/DG-Net-master/test_2label.py", line 204, in
gallery_feature = extract_feature(model,dataloaders['gallery'])
File "/home/waq/Downloads/ai/re_person/code/DG-Net/DG-Net-master/test_2label.py", line 131, in extract_feature
x[0] = norm(x[0])
File "/home/waq/Downloads/ai/re_person/code/DG-Net/DG-Net-master/test_2label.py", line 109, in norm
fnorm = torch.norm(f, p=2, dim=1, keepdim=True)
File "/home/waq/anaconda3/envs/re_person/lib/python3.6/site-packages/torch/functional.py", line 1337, in norm
return _VF.norm(input, p, _dim, keepdim=keepdim) # type: ignore
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)

Process finished with exit code 1

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions