Yolact: 'list' object has no attribute 'argsort'

Created on 28 Jan 2020  路  5Comments  路  Source: dbolya/yolact

Hi,
I am running YOLACT++ on a Jetson Xavier and getting the following error not always, but occasionally. What could be the reason for such an error?

Traceback (most recent call last):
  File "eval.py", line 1103, in <module>
    evaluate(net, dataset)
  File "eval.py", line 890, in evaluate
    evalvideo(net, args.video)
  File "eval.py", line 830, in evalvideo
    frame_buffer.put(frame['value'].get())
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 644, in get
    raise self._value
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "eval.py", line 710, in prep_frame
    return prep_display(preds, frame, None, None, undo_transform=False, class_color=True, fps_str=fps_str)
  File "eval.py", line 155, in prep_display
    idx = t[1].argsort(0, descending=True)[:args.top_k]
AttributeError: 'list' object has no attribute 'argsort'

Most helpful comment

@serhatiscan do not use multithreading.
python eval.py --video_multiframe=1 ...

All 5 comments

Have you modified the code at all, or are you running this with multithreading or something?

So it looks like the scores returned by postprocess are being returned as [box_scores, mask_scores] which is the behavior when cfg.rescore_bbox=False. When that's True, it instead returns just one vector that combines both the box and mask scores into one. The False setting is the default for YOLACT++ because of it's mask rescoring network and that means the mAP eval pipeline needs both the mask and box scores independently. But for just displaying, it's fine to combine them so I do a "hack" where I save the rescore_bbox config setting before calling postprocess and set that global variable to True (then revert it afterward). If there are any race conditions or if anything weird is happening globally, this hack could fail.

Actually I did not use any trick, just used the code off-the-shelf. I also tried running it on a Colab notebook that we can find out if that stems from an architecture issue, but the results were the same.
Apparently this hack you explained fails. The code does the job most of the time but some issues happen on runtime and I observe occasional crashes. According to your explanation, as long as I use YOLACT++, I could simplify this part of the code and use the default False setting on the global parameter. What should I do to avoid these crashes and obtain a stable performance?

@serhatiscan do not use multithreading.
python eval.py --video_multiframe=1 ...

@serhatiscan @enhany's suggestion should work. I didn't realize that you were using evalvideo, which uses mulithreading by default. If you want to keep using multithreading (i.e., without setting multiframe to 1) you can just set the global variable to True (by changing 'rescore_bbox': False, in yolact_plus_base_config in data/config.py to 'rescore_bbox': True,). This will break the regular eval mode, but if you're not computing mAP it should be fine.

Thanks @dbolya @enhany for the suggestions! It seems I overlooked about the multithreading use.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

explorer359 picture explorer359  路  10Comments

CzJaewan picture CzJaewan  路  5Comments

Zhang-O picture Zhang-O  路  6Comments

stevedipaola picture stevedipaola  路  8Comments

onoderay picture onoderay  路  6Comments