项目场景:
在使用UFLD车道线检测算法针对CULane数据集进行训练的过程中遇到了no out0_normal.txt文件的bug!!!
问题描述
FileNotFoundError: [Errno 2] No such file or directory: '/line_detection/UFLD-v2/log_culane/20231218_191137_lr_5e-02_b_32/txt/out0_normal.txt'
loading cached data
cached data loaded
556
100%|███| 556/556 [16:39<00:00, 1.80s/it, col_top1=0.018, col_top2=0.049, col_top3=0.078, ext_col=0.909, ext_row=0.865, loss=7.990, top1=0.024, top2=0.071, top3=0.118]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 420/420 [04:28<00:00, 1.57it/s]
sh: 1: ./evaluation/culane/evaluate: not found
sh: 1: ./evaluation/culane/evaluate: not found
sh: 1: ./evaluation/culane/evaluate: not found
sh: 1: ./evaluation/culane/evaluate: not found
sh: 1: ./evaluation/culane/evaluate: not found
sh: 1: ./evaluation/culane/evaluate: not found
sh: 1: ./evaluation/culane/evaluate: not found
sh: 1: ./evaluation/culane/evaluate: not found
sh: 1: ./evaluation/culane/evaluate: not found
Traceback (most recent call last):
File "train.py", line 120, in <module>
res = eval_lane(net, cfg, ep = epoch, logger = logger)
File "/line_detection/UFLD-v2/evaluation/eval_wrapper.py", line 899, in eval_lane
res = call_culane_eval(cfg.data_root, 'culane_eval_tmp', cfg.test_work_dir)
File "/line_detection/UFLD-v2/evaluation/eval_wrapper.py", line 1022, in call_culane_eval
res_all['res_normal'] = read_helper(out0)
File "/line_detection/UFLD-v2/evaluation/eval_wrapper.py", line 960, in read_helper
lines = open(path, 'r').readlines()[1:]
FileNotFoundError: [Errno 2] No such file or directory: '/line_detection/UFLD-v2/log_culane/20231218_191137_lr_5e-02_b_32/txt/out0_normal.txt'
原因分析:
没有仔细阅读install readme!!!
解决方案:
Install CULane evaluation tools (Only required for testing).
If you just want to train a model or make a demo, this tool is not necessary and you can skip this step. If you want to get the evaluation results on CULane, you should install this tool.
This tools requires OpenCV C++. Please follow here to install OpenCV C++. When you build OpenCV, remove the paths of anaconda from PATH or it will be failed.
First you need to install OpenCV C++.
After installation, make a soft link of OpenCV include path.
ln -s /usr/local/include/opencv4/opencv2 /usr/local/include/opencv2
We provide three kinds of complie pipelines to build the evaluation tool of CULane.
Option 1:
cd evaluation/culane
make
Option 2:
cd evaluation/culane
mkdir build && cd build
cmake ..
make
mv culane_evaluator ../evaluate
okok问题解决!!!