先定位到错误的代码,
File "/home/nanashi/zwq/Temporal_Action_Detection/R-C3D/experiments/OMRON/test/Evaluation/eval_detection.py", line 115, in _import_prediction
raise IOError('Please input a valid prediction file.')
IOError: Please input a valid prediction file.
就是这个def _import_prediction里面的checking format...
编辑一个debugg的脚本,修改eval_detection.py文件里面的代码,
用print输出,查看data和prediction_filename的内容,发现并没有上面异常。
发现上面代码里,在def _import_ground_truth函数里面
也有一部分是类似的,
思路:
1、查看if not all([field in data.keys() for field in self.pred_fields]):代码的含义,
其中的** in ** for ** in **
2、尝试消除问题,注释掉出问题的代码
然后再在debugg脚本里面调试,发现输出了,没有报错。
[INIT] Loaded annotations from validation subset.
Number of ground truth instances: 1400
Number of predictions: 4764
Fixed threshold for tiou score: [0.5]
[RESULTS] Performance on ActivityNet detection task.
Average-mAP: 0.872661636994
得到了验证集上的精度。
17点03分
21:08
尝试运行分割的函数,
Traceback (most recent call last):
File "/home/nanashi/pycharm-community-2020.3.3/plugins/python-ce/helpers/pydev/pydevd.py", line 1477, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/nanashi/zwq/Temporal_Action_Detection/R-C3D/preprocess/OMRON/generate_frames.py", line 33, in
generate_frame('training')
File "/home/nanashi/zwq/Temporal_Action_Detection/R-C3D/preprocess/OMRON/generate_frames.py", line 27, in generate_frame
ffmpeg(filename, outfile, fps)
File "/home/nanashi/zwq/Temporal_Action_Detection/R-C3D/preprocess/OMRON/util.py", line 60, in ffmpeg
pipe = subprocess.Popen(command, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
File "/home/nanashi/anaconda3/envs/py27/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
File "/home/nanashi/anaconda3/envs/py27/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
python-BaseException
https://blog.csdn.net/weixin_44686101/article/details/110224288
sudo ln -s /usr/bin/python /usr/local/bin/python
不好用
https://stackoverflow.com/questions/29454002/filenotfounderror-errno-2-no-such-file-or-directory-ffmpeg
sudo apt-get install ffmpeg
问题解决!
PS:在看完几个参数的值后,其实我感觉也是没有ffmpeg安装包,所以百度了“python里ffmpeg”
https://blog.csdn.net/qq_34971175/article/details/79485665
https://blog.csdn.net/liuyuinsdu/article/details/114646684?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_title-0&spm=1001.2101.3001.4242