SceneSeg icon indicating copy to clipboard operation
SceneSeg copied to clipboard

How to solve NoneType error when running demo

Open braveapple opened this issue 2 years ago • 1 comments

When I run this demo code, I got this 'NoneType' error. Could you give me any suggestions on this?

(1) run code:

cd pre
python demodownload.py ## Download a YouTube video with pytube
python ShotDetect/shotdetect.py --print_result --save_keyf --save_keyf_txt ## Cut shot 
cd ../lgss
python run.py config/demo.py ## Cut scene 

(2) print log as follows:

Downloading: "https://download.pytorch.org/models/resnet50-19c8e357.pth" to /usr/local/app/.cache/torch/hub/checkpoints/resnet50-19c8e357.pth
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 97.8M/97.8M [00:30<00:00, 3.41MB/s]
...data and model loaded
...test with saved model
=> Loaded checkpoint '../run/image50/model_best.pth.tar'
AP: 1.000
mAP: 1.000
Average loss: 1.7054, Accuracy: 1/10 (10%)
Accuracy1: 1/10 (10%), Accuracy0: 0/0 (0%)
gts = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], preds = [0.05882452055811882, 0.043319448828697205, 0.14641502499580383, 0.15955811738967896, 0.1980414241552353, 0.1355811506509781, 0.48238664865493774, 0.48149824142456055, 0.17736411094665527, 0.5957018733024597]
Miou:  0.18324022346368712
Recall:  0.1
Recall_at_3:  0.0999999000001
...visualize scene video in demo mode, the above quantitive metrics are invalid
{'0335': 0, '0336': 0, '0337': 0, '0338': 0, '0339': 0, '0340': 0, '0341': 0, '0342': 0, '0343': 0, '0344': 0}
Traceback (most recent call last):
  File "run.py", line 208, in <module>
    main()
  File "run.py", line 202, in main
    scene_dict, scene_list = pred2scene(cfg, threshold=0.8)
  File "SceneSeg/lgss/utilis/dataset_utilis.py", line 167, in pred2scene
    scene_list, pair_list = get_demo_scene_list(cfg, pred_list)
  File "SceneSeg/lgss/utilis/dataset_utilis.py", line 56, in get_demo_scene_list
    for pair in pair_list:
TypeError: 'NoneType' object is not iterable

braveapple avatar Aug 04 '22 06:08 braveapple

When I run this demo code, I got this 'NoneType' error. Could you give me any suggestions on this?

(1) run code:

cd pre
python demodownload.py ## Download a YouTube video with pytube
python ShotDetect/shotdetect.py --print_result --save_keyf --save_keyf_txt ## Cut shot 
cd ../lgss
python run.py config/demo.py ## Cut scene 

(2) print log as follows:

Downloading: "https://download.pytorch.org/models/resnet50-19c8e357.pth" to /usr/local/app/.cache/torch/hub/checkpoints/resnet50-19c8e357.pth
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 97.8M/97.8M [00:30<00:00, 3.41MB/s]
...data and model loaded
...test with saved model
=> Loaded checkpoint '../run/image50/model_best.pth.tar'
AP: 1.000
mAP: 1.000
Average loss: 1.7054, Accuracy: 1/10 (10%)
Accuracy1: 1/10 (10%), Accuracy0: 0/0 (0%)
gts = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], preds = [0.05882452055811882, 0.043319448828697205, 0.14641502499580383, 0.15955811738967896, 0.1980414241552353, 0.1355811506509781, 0.48238664865493774, 0.48149824142456055, 0.17736411094665527, 0.5957018733024597]
Miou:  0.18324022346368712
Recall:  0.1
Recall_at_3:  0.0999999000001
...visualize scene video in demo mode, the above quantitive metrics are invalid
{'0335': 0, '0336': 0, '0337': 0, '0338': 0, '0339': 0, '0340': 0, '0341': 0, '0342': 0, '0343': 0, '0344': 0}
Traceback (most recent call last):
  File "run.py", line 208, in <module>
    main()
  File "run.py", line 202, in main
    scene_dict, scene_list = pred2scene(cfg, threshold=0.8)
  File "SceneSeg/lgss/utilis/dataset_utilis.py", line 167, in pred2scene
    scene_list, pair_list = get_demo_scene_list(cfg, pred_list)
  File "SceneSeg/lgss/utilis/dataset_utilis.py", line 56, in get_demo_scene_list
    for pair in pair_list:
TypeError: 'NoneType' object is not iterable

Hello braveapple, I have encountered the same problem like yours. Have you solved it already?

Bornedtobewilling avatar Nov 21 '22 11:11 Bornedtobewilling