WisconsinAIVision / yolact_edge

The first competitive instance segmentation approach that runs on small edge devices at real-time speeds.
MIT License
1.26k stars 272 forks source link

TypeError: can only concatenate list (not "dict") to list #159

Open vipelz opened 2 years ago

vipelz commented 2 years ago

Hello First of all thank you for your great work and sorry if this is a noob problem. I am not a developer, just a young architect fascinated by technology. I read about YOLO a few months then about the Instance Segmentation, Yolact and now yolact_edge. So I bought an Intel i5-11400, a used k80 GPU few months ago and build a pc just because I wanted to try this software that seemed magical to me. I installed Ubuntu and only now have I been able to get Docker to work and start yolact_edge! : D.

This is my environment:

The proble, is that I would like to use Yolact edge with my webcam but it doesn't start.

appuser@6ad5e498dcef:/yolact_edge$ python eval.py --trained_model=weights/yolact_edge_54_800000.pth --score_threshold=0.3 --top_k=100 --video_multiframe=2 --trt_batch_size 2 --video=0 --disable_tensorrt
Config not specified. Parsed yolact_edge_config from the file name.

[10/24 23:35:48 yolact.eval]: Loading model...
[10/24 23:35:49 yolact.eval]: Model loaded.
Initializing model... Traceback (most recent call last):
  File "eval.py", line 1280, in <module>
    evaluate(net, dataset)
  File "eval.py", line 927, in evaluate
    evalvideo(net, args.video)
  File "eval.py", line 767, in evalvideo
    eval_network(transform_frame(get_next_frame(vid)))
  File "eval.py", line 700, in eval_network
    net_outs = net(imgs, extras=extras)
  File "/home/appuser/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/appuser/.local/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 162, in forward
    return self.gather(outputs, self.output_device)
  File "eval.py", line 649, in gather
    return sum(outputs, [])
TypeError: can only concatenate list (not "dict") to list
appuser@6ad5e498dcef:/yolact_edge$ 

Instead with a video file mp4 I was able to use it and it works:

appuser@e556300749dc:~/yolact_edge$ python eval.py --trained_model=weights/yolact_edge_54_800000.pth --video=/home/appuser/yolact_edge/data/sample.mp4:out.mp4 --disable_tensorrt
Config not specified. Parsed yolact_edge_config from the file name.

[10/25 00:16:17 yolact.eval]: Loading model...
[10/25 00:16:19 yolact.eval]: Model loaded.
Processing Frames  ██████████████████████████████   1889 /   1889 (100.00%)     6.08 fps   

Thank you in advance for your reply!

283pm commented 2 years ago

Do you find any solution? I have the same issue.

haotian-liu commented 2 years ago

This could be a issue in multi-GPU environments. Fixes will be pushed later when the issue is identified. You can try set CUDA_VISIBLE_DEVICES=0 as a temporary solution towards this. Thanks!

283pm commented 2 years ago

Thank you! It works fine!