MengyangPu / EDTER

EDTER: Edge Detection with Transformer, in CVPR 2022
MIT License
284 stars 34 forks source link

IndexError: too many indices for array: array is 3-dimensional, but 4 were indexed #57

Open kulkarnikeerti opened 1 year ago

kulkarnikeerti commented 1 year ago

Hi @MengyangPu

Sorry to disturb you again with these many questions. I have encountered another error during testing. Error is as below:

 Traceback (most recent call last):
  File "./tools/test.py", line 142, in <module>
    main()
  File "./tools/test.py", line 129, in main
    outputs = single_gpu_test(model, data_loader, args.show, args.show_dir)
  File "/home/keerti/PycharmProjects/EDTER-main/mmseg/apis/test.py", line 67, in single_gpu_test
    out_file=out_file)
  File "/home/keerti/PycharmProjects/EDTER-main/mmseg/models/segmentors/base.py", line 259, in show_result
    color_seg[seg == label, :] = color
IndexError: too many indices for array: array is 3-dimensional, but 4 were indexed

Could you please help me what might be the reason for this error? PS: I have not changed any of the code. I am just trying to test the model

kulkarnikeerti commented 1 year ago

@MengyangPu, I tried to get the shapes of the variables involved here. color_seg.shape = (1, 321, 3) seg.shape = (1, 321, 481) label = 0 color = [0, 0, 0]

Do you think the output values here are causing the error?

sunregins commented 1 year ago

@MengyangPu, I tried to get the shapes of the variables involved here. color_seg.shape = (1, 321, 3) seg.shape = (1, 321, 481) label = 0 color = [0, 0, 0]

Do you think the output values here are causing the error?

did you finish testing? i cannot address this problem

MengyangPu commented 1 year ago

Please set launcher=pytorch in the ./tools/test.py, and use the function multi_gpu_test.