PaddleVideo icon indicating copy to clipboard operation
PaddleVideo copied to clipboard

footballaction中extract_feat.py报错

Open fnxdxh opened this issue 4 years ago • 1 comments

运行环境: wsl2 ubuntu18.04 GTX 1660TI 6G显存 i5-9300h 四核八线程 16G内存

(soccer1) yuanyue@DESKTOP-7B1QQUT:/mnt/e/FootballAction/extractor$ python extract_feat.py
2021-03-12 20:52:41,205-INFO: load model ...
2021-03-12 20:52:41,237-INFO: ---------------- Infer Arguments ----------------
2021-03-12 20:52:41,237-INFO: COMMON:
2021-03-12 20:52:41,237-INFO:     fps:5
2021-03-12 20:52:41,237-INFO:     use_gpu:True
2021-03-12 20:52:41,237-INFO:     imgs_path:data/test/frames/
2021-03-12 20:52:41,237-INFO:     pcm_path:data/test/audio/11.pcm
2021-03-12 20:52:41,238-INFO:     feature_path:data/test/feature/output_11.pkl
2021-03-12 20:52:41,238-INFO:     label_dic:configs/index_label_football_8.json
2021-03-12 20:52:41,238-INFO:     props_path:tmp/bmn.txt
2021-03-12 20:52:41,238-INFO:     classify_path:tmp/result.json
2021-03-12 20:52:41,238-INFO:     clssify_topk:1
2021-03-12 20:52:41,238-INFO: TSN:
2021-03-12 20:52:41,238-INFO:     name:TSN
2021-03-12 20:52:41,238-INFO:     weight_path:/mnt/e/FootballAction/checkpoints/models_tsn/TSN_epoch36.pdparams
2021-03-12 20:52:41,238-INFO:     format:jpg
2021-03-12 20:52:41,239-INFO:     num_classes:8
2021-03-12 20:52:41,239-INFO:     seg_num:7
2021-03-12 20:52:41,239-INFO:     seglen:1
2021-03-12 20:52:41,239-INFO:     image_mean:[0.485, 0.456, 0.406]
2021-03-12 20:52:41,239-INFO:     image_std:[0.229, 0.224, 0.225]
2021-03-12 20:52:41,239-INFO:     num_layers:50
2021-03-12 20:52:41,239-INFO:     short_size:256
2021-03-12 20:52:41,240-INFO:     target_size:224
2021-03-12 20:52:41,240-INFO:     num_reader_threads:12
2021-03-12 20:52:41,240-INFO:     buf_size:1024
2021-03-12 20:52:41,240-INFO:     batch_size:128
2021-03-12 20:52:41,240-INFO:     image_scale:2048
2021-03-12 20:52:41,240-INFO:     audio_scale:640
2021-03-12 20:52:41,240-INFO: AUDIO:
2021-03-12 20:52:41,240-INFO:     name:AUDIO
2021-03-12 20:52:41,240-INFO:     weight_path:/mnt/e/FootballAction/checkpoints/models_audio/audio.pdparams
2021-03-12 20:52:41,240-INFO:     sample_rate:16000
2021-03-12 20:52:41,240-INFO:     pcm_file:tmp/1.pcm
2021-03-12 20:52:41,240-INFO:     feature_names:['audio']
2021-03-12 20:52:41,240-INFO:     feature_dims:[[50, 64]]
2021-03-12 20:52:41,240-INFO:     lstm_size_audio:1024
2021-03-12 20:52:41,241-INFO:     batch_size:32
2021-03-12 20:52:41,241-INFO: BMN:
2021-03-12 20:52:41,241-INFO:     name:BMN
2021-03-12 20:52:41,241-INFO:     subset:test
2021-03-12 20:52:41,241-INFO:     weight_path:/mnt/e/FootballAction/checkpoints/models_bmn/BMN_epoch19.pdparams
2021-03-12 20:52:41,241-INFO:     window_step:200
2021-03-12 20:52:41,241-INFO:     tscale:200
2021-03-12 20:52:41,241-INFO:     dscale:200
2021-03-12 20:52:41,241-INFO:     feat_dim:2048
2021-03-12 20:52:41,241-INFO:     prop_boundary_ratio:0.5
2021-03-12 20:52:41,241-INFO:     num_sample:32
2021-03-12 20:52:41,241-INFO:     num_sample_perbin:3
2021-03-12 20:52:41,241-INFO:     batch_size:1
2021-03-12 20:52:41,241-INFO:     num_threads:8
2021-03-12 20:52:41,242-INFO:     nms_thread:0.7
2021-03-12 20:52:41,242-INFO:     score_thread:0.01
2021-03-12 20:52:41,242-INFO:     output_path:logs/BMN_results
2021-03-12 20:52:41,242-INFO:     result_path:logs/BMN_results
2021-03-12 20:52:41,242-INFO: ACTION:
2021-03-12 20:52:41,242-INFO:     name:ActionNet
2021-03-12 20:52:41,242-INFO:     dataset:lstmdata
2021-03-12 20:52:41,242-INFO:     bone_nework:None
2021-03-12 20:52:41,242-INFO:     subset:test
2021-03-12 20:52:41,242-INFO:     drop_rate:0.5
2021-03-12 20:52:41,242-INFO:     feature_num:2
2021-03-12 20:52:41,242-INFO:     feature_names:['rgb', 'audio']
2021-03-12 20:52:41,242-INFO:     feature_dims:[2048, 1024]
2021-03-12 20:52:41,242-INFO:     embedding_size:512
2021-03-12 20:52:41,242-INFO:     lstm_size_img:2048
2021-03-12 20:52:41,242-INFO:     lstm_size_audio:1024
2021-03-12 20:52:41,242-INFO:     num_classes:8
2021-03-12 20:52:41,243-INFO:     topk:1
2021-03-12 20:52:41,243-INFO:     with_bn:True
2021-03-12 20:52:41,243-INFO:     weight_path:/mnt/e/FootballAction/checkpoints/models_lstm/ActionNet_epoch14_acc82.34873749404478.pdparams
2021-03-12 20:52:41,243-INFO:     batch_size:1
2021-03-12 20:52:41,243-INFO:     nms_thread:0.01
2021-03-12 20:52:41,243-INFO:     nms_offset:10
2021-03-12 20:52:41,243-INFO:     classify_score_thread:0.05
2021-03-12 20:52:41,243-INFO:     iou_score_thread:0.1
2021-03-12 20:52:41,243-INFO: -------------------------------------------------
2021-03-12 20:52:41,267-INFO: TSN
2021-03-12 20:52:41,267-INFO: /mnt/e/FootballAction/checkpoints/models_tsn/TSN_epoch36.pdparams
2021-03-12 20:52:50,207-INFO: AUDIO
2021-03-12 20:52:50,207-INFO: /mnt/e/FootballAction/checkpoints/models_audio/audio.pdparams
2021-03-12 20:52:51,168-INFO: step0: load model time: 0.16541232665379843 min

2021-03-12 20:52:51,172-INFO: predict ...
2021-03-12 20:52:51,172-INFO: /mnt/e/FootballAction/datasets/EuroCup2016/mp4/76b5f7ee28d942988c6b224bfac136bd.mp4
获得image_path_list
获得infer_configs
W0312 20:53:05.027586 23616 device_context.cc:252] Please NOTE: device: 0, CUDA Capability: 75, Driver API Version: 11.3, Runtime API Version: 10.0
W0312 20:53:05.147099 23616 device_context.cc:260] device: 0, cuDNN Version: 7.6.
获得audio_features
获得np_audio_features
2021-03-12 20:53:14,098-INFO: len of  self.video_path 30856
获得image_features
获得np_image_features
--- Logging error ---
Traceback (most recent call last):
  File "/home/yuanyue/anaconda3/envs/soccer1/lib/python3.6/logging/__init__.py", line 994, in emit
    msg = self.format(record)
  File "/home/yuanyue/anaconda3/envs/soccer1/lib/python3.6/logging/__init__.py", line 840, in format
    return fmt.format(record)
  File "/home/yuanyue/anaconda3/envs/soccer1/lib/python3.6/logging/__init__.py", line 577, in format
    record.message = record.getMessage()
  File "/home/yuanyue/anaconda3/envs/soccer1/lib/python3.6/logging/__init__.py", line 338, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "extract_feat.py", line 105, in <module>
    video_classify(line)
  File "extract_feat.py", line 72, in video_classify
    logger.info(np_image_features.shape, np_audio_features.shape)
Message: (30849, 2048)
Arguments: ((6170, 1024),)
2021-03-12 21:03:09,624-INFO: step1: feature extract time: 10.307358145713806 min
提取特征成功
保存特征成功
2021-03-12 21:03:11,088-INFO: predict ...
2021-03-12 21:03:11,088-INFO: /mnt/e/FootballAction/datasets/EuroCup2016/mp4/250b88724acf40dbb6d7e8ccb400ef38.mp4
获得image_path_list
获得infer_configs
Killed

为了方便debug我在代码里加了一些print

首先是Logging error 然后就是无法连续输出,输出一个feature以后就会直接被killed

在feature文件夹中发现一个272333kb的.pkl文件,不清楚是否完整输出了第一个视频的feature

fnxdxh avatar Mar 12 '21 13:03 fnxdxh

这是logger的错误,line72改为如下就好了 logger.info("feature shape {} {}".format(np_image_features.shape, np_audio_features.shape)) 我更新下代码

wgh1989 avatar Mar 16 '21 06:03 wgh1989