PaddlePaddle / PaddleDetection

Object Detection toolkit based on PaddlePaddle. It supports object detection, instance segmentation, multiple object tracking and real-time multi-person keypoint detection.
Apache License 2.0
12.61k stars 2.86k forks source link

[BUG] 关于 test_tipc 脚本 #4729

Open FL77N opened 2 years ago

FL77N commented 2 years ago

在使用 test_tipc 时,没有报错,请问出现了这个是啥情况呢

aistudio@jupyter-374446-2883407:~/PaddleDetection$ bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/fast_rcnn_r50_fpn_1x_coco.txt 'lite_train_infer' ppdet python_infer: fast_rcnn_r50_fpn_1x_coco

ghostxsl commented 2 years ago

这个只是打印的信息,没有后续的log了吗?

FL77N commented 2 years ago

这个只是打印的信息,没有后续的log了吗?

...没有就这一行

ghostxsl commented 2 years ago

image 上面有一行报错,不知道为啥你那边没有打印出来,你这里制定的config的路径不对,正确的应该是: bash test_tipc/test_train_inference_python.sh test_tipc/configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco_train_infer_python.txt lite_train_infer

FL77N commented 2 years ago

image 上面有一行报错,不知道为啥你那边没有打印出来,你这里制定的config的路径不对,正确的应该是: bash test_tipc/test_train_inference_python.sh test_tipc/configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco_train_infer_python.txt lite_train_infer

意思是我必须得放到 fast_rcnn 的文件里面?是的我是直接把 fast_rcnn_r50_fpn_1x_coco.txt 放到 configs 下的

ghostxsl commented 2 years ago

啥意思?你自己写了个txt的配置文件?没有用repo里的?

FL77N commented 2 years ago

啥意思?你自己写了个txt的配置文件?没有用repo里的?

对啊,我的模型是 fast_rcnn 啊,我照着 faster_rcnn 改的

ghostxsl commented 2 years ago

那你发一下你自己写的这个fast_rcnn_r50_fpn_1x_coco.txt,我看一下

FL77N commented 2 years ago

那你发一下你自己写的这个fast_rcnn_r50_fpn_1x_coco.txt,我看一下

===========================train_params=========================== model_name:fast_rcnn_r50_fpn_1x_coco python:python3.7 gpu_list:0 use_gpu:True auto_cast:null|amp epoch:lite_train_lite_infer=1|lite_train_whole_infer=1|whole_train_whole_infer=12 save_dir:./output/ TrainReader.batch_size:lite_train_lite_infer=2|lite_train_whole_infer=2|whole_train_whole_infer=1 pretrain_weights:null trained_model_name:fast_rcnn_r50_fpn_1x_coco/model_final.pdparams train_infer_img_dir:./dataset/coco/test2017/ filename:null

trainer:norm_train norm_train:tools/train.py -c configs/fast_rcnn/fast_rcnn_r50_1x_coco.yml -o pact_train:tools/train.py -c configs/fast_rcnn/fast_rcnn_r50_1x_coco.yml --slim_config _template_pact -o fpgm_train:tools/train.py -c configs/fast_rcnn/fast_rcnn_r50_1x_coco.yml --slim_config _template_fpgm -o distill_train:null null:null null:null

===========================eval_params=========================== eval:tools/eval.py -c configs/fast_rcnn/faster_rcnn_r50_1x_coco.yml -o null:null

===========================infer_params=========================== --output_dir:./output_inference weights: norm_export:tools/export_model.py -c configs/fast_rcnn/fast_rcnn_r50_1x_coco.yml -o pact_export:tools/export_model.py -c configs/fast_rcnn/fast_rcnn_r50_1x_coco.yml --slim_config _template_pact -o fpgm_export:tools/export_model.py -c configs/fast_rcnn/fast_rcnn_r50_1x_coco.yml --slim_config _template_fpgm -o distill_export:null export1:null export2:null kl_quant_export:tools/post_quant.py -c configs/faster_rcnn/fast_rcnn_r50_1x_coco.yml --slim_config _template_kl_quant -o

infer_mode:norm infer_quant:False inference:./deploy/python/infer.py --device:gpu|cpu --enable_mkldnn:True|False --cpu_threads:1|6 --batch_size:1 --use_tensorrt:null --run_mode:fluid|trt_fp32|trt_fp16 --model_dir:./test_tipc/output/norm_train_gpus_0_autocast_null/fast_rcnn_r50_fpn_1x_coco --image_dir:./test_tipc/demo --save_log_path:null --run_benchmark:True --trt_max_shape:1600

ghostxsl commented 2 years ago

你中间那些是空行吗?不要有空行,看起来没啥问题。是这样的,你可以根据repo里的修改自己config文件,但是不要增加多余的空行,以及删除某些行,你可以修改其中的参数。要不然脚本读不到正确的参数

ghostxsl commented 2 years ago

https://github.com/PaddlePaddle/PaddleDetection/blob/develop/test_tipc/tools/template/train_infer_python.txt 这里有txt配置文件的模板,你只能修改,不能增加行或者删除行。 这个不是yml,没有那么智能😓

FL77N commented 2 years ago

你中间那些是空行吗?不要有空行,看起来没啥问题。是这样的,你可以根据repo里的修改自己config文件,但是不要增加多余的空行,以及删除某些行,你可以修改其中的参数。要不然脚本读不到正确的参数

欧克,我懂了,我对一下,谢谢呀

FL77N commented 2 years ago

你中间那些是空行吗?不要有空行,看起来没啥问题。是这样的,你可以根据repo里的修改自己config文件,但是不要增加多余的空行,以及删除某些行,你可以修改其中的参数。要不然脚本读不到正确的参数

model_name=$(func_parser_value "${lines[1]}") python=$(func_parser_value "${lines[2]}") gpu_list=$(func_parser_value "${lines[3]}") train_use_gpu_key=$(func_parser_key "${lines[4]}") train_use_gpu_value=$(func_parser_value "${lines[4]}")

您好,这里的 lines[1] 指的是 train_infer_python.txt 的第一行吗?可是第一行是 ===========================train_params=========================== 第二行才是 model_name:fast_rcnn_r50_fpn_1x_coco

ghostxsl commented 2 years ago

这个index是从0开始的

FL77N commented 2 years ago

这个index是从0开始的

抱歉。。。

FL77N commented 2 years ago

image 上面有一行报错,不知道为啥你那边没有打印出来,你这里制定的config的路径不对,正确的应该是: bash test_tipc/test_train_inference_python.sh test_tipc/configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco_train_infer_python.txt lite_train_infer

为啥我把 faster_rcnn_r50_fpn_1x_coco_train_infer_python.txt 放到 test_tipc/configs/ 并执行 bash test_tipc/test_train_inference_python.sh test_tipc/configs/faster_rcnn_r50_fpn_1x_coco_train_infer_python.txt lite_train_infer 下会报错找不到文件 test_tipc/configs/faster_rcnn_r50_fpn_1x_coco_train_infer_python.txt 但是我把它放到 test_tipc/configs/faster_rcnn/ 下就能正常运行呢?

ghostxsl commented 2 years ago

image 我这里运行可以的啊,怎么感觉你的环境有点问题呢~

ghostxsl commented 2 years ago

我放到随便一个目录都能跑的起来😓

FL77N commented 2 years ago

我放到随便一个目录都能跑的起来😓

我就是觉得奇怪,我是在 aistudio 上跑的

ghostxsl commented 2 years ago

我放到随便一个目录都能跑的起来😓

我就是觉得奇怪,我是在 aistudio 上跑的

又是aistudio。。。。今天也有个用户说它跑模型跑不起来,我在本地跑没问题,也是aistudio上跑的。。。。 aistudio有用户群吗?你可以去问问~

FL77N commented 2 years ago

我放到随便一个目录都能跑的起来😓

我就是觉得奇怪,我是在 aistudio 上跑的

又是aistudio。。。。今天也有个用户说它跑模型跑不起来,我在本地跑没问题,也是aistudio上跑的。。。。 aistudio有用户群吗?你可以去问问~

不知道有没有群诶,我明天去本地试试

FL77N commented 2 years ago

我放到随便一个目录都能跑的起来sweat

我就是觉得奇怪,我是在 aistudio 上跑的

又是aistudio。。。。今天也有个用户说它跑模型跑不起来,我在本地跑没问题,也是aistudio上跑的。。。。 aistudio有用户群吗?你可以去问问~

我发现几个问题 第一个 for autocast in ${autocast_list[]}; do for trainer in ${trainer_list[]}; do flag_quant=False echo "1 ${trainer}" echo "2 ${norm_key}" if [ ${trainer} = "${norm_key}" ]; then echo "enter" run_train=${norm_trainer} run_export=${norm_export}

打印如下: on/test_tipc/test_train_inference_python.sh ./test_tipc/configs/fast_rcnn_r50_fpn_1x_coco_train_infer_python.txt 'lite_train_lite_infer' ppdet python_infer: fast_rcnn_r50_fpn_1x_coco 1 norm_train 2 norm_train

trainer 和 norm_key 明明相同但是却没有进 if [ ${trainer} = "${norm_key}" ]; then 这个判断分支

第二个 if [ ${#gpu} -le 2 ];then # train with cpu or single gpu cmd="${python} ${run_train} ${set_use_gpu} ${set_save_model} ${set_epoch} ${set_pretrain} ${set_batchsize} ${set_filename} ${set_autocast}" echo "${python}" echo "${run_train}" echo "${set_use_gpu}" echo "${cmd}"

打印如下 python3.7 tools/train.py -c configs/fast_rcnn/fast_rcnn_r50_fpn_1x_coco.yml -o use_gpu=True rainReader.batch_size=2 filename=fast_rcnn_r50_fpn_1x_cococo.yml -o /home/l77/DeepLearning/model/detection/fast_rcnn/PaddleDetection/PaddleDetection/test_tipc/test_train_inference_python.sh: 行 296: $'python3.7\r': 未找到命令 ! nReader.batch_size=2 filename=fast_rcnn_r50_fpn_1x_cococo.yml -o

每一部分的值能获取,但是合到一起的 cmd 就不完全,以至于后面找不到命令(即命令不对)

ghostxsl commented 2 years ago

我放到随便一个目录都能跑的起来sweat

我就是觉得奇怪,我是在 aistudio 上跑的

又是aistudio。。。。今天也有个用户说它跑模型跑不起来,我在本地跑没问题,也是aistudio上跑的。。。。 aistudio有用户群吗?你可以去问问~

我发现几个问题 第一个 for autocast in ${autocastlist[]}; do for trainer in ${trainerlist[]}; do flag_quant=False echo "1 ${trainer}" echo "2 ${norm_key}" if [ ${trainer} = "${norm_key}" ]; then echo "enter" run_train=${norm_trainer} run_export=${norm_export}

打印如下: on/test_tipc/test_train_inference_python.sh ./test_tipc/configs/fast_rcnn_r50_fpn_1x_coco_train_infer_python.txt 'lite_train_lite_infer' ppdet python_infer: fast_rcnn_r50_fpn_1x_coco 1 norm_train 2 norm_train

trainer 和 norm_key 明明相同但是却没有进 if [ ${trainer} = "${norm_key}" ]; then 这个判断分支

第二个 if [ ${#gpu} -le 2 ];then # train with cpu or single gpu cmd="${python} ${run_train} ${set_use_gpu} ${set_save_model} ${set_epoch} ${set_pretrain} ${set_batchsize} ${set_filename} ${set_autocast}" echo "${python}" echo "${run_train}" echo "${set_use_gpu}" echo "${cmd}"

打印如下 python3.7 tools/train.py -c configs/fast_rcnn/fast_rcnn_r50_fpn_1x_coco.yml -o use_gpu=True rainReader.batch_size=2 filename=fast_rcnn_r50_fpn_1x_cococo.yml -o /home/l77/DeepLearning/model/detection/fast_rcnn/PaddleDetection/PaddleDetection/test_tipc/test_train_inference_python.sh: 行 296: $'python3.7\r': 未找到命令 ! nReader.batch_size=2 filename=fast_rcnn_r50_fpn_1x_cococo.yml -o

每一部分的值能获取,但是合到一起的 cmd 就不完全,以至于后面找不到命令(即命令不对)

你这里是不是写错了,$'python3.7\r'这里后面的\r是啥?

FL77N commented 2 years ago

我基本都是直接用的 ppdet 中的呀,而且第一个明明判断为 True 没有进分支也很奇怪

ghostxsl commented 2 years ago

第一个判断为True没进分支也太诡异了吧。。。是不是bash环境有问题啊?

FL77N commented 2 years ago

第一个判断为True没进分支也太诡异了吧。。。是不是bash环境有问题啊?

本地和 AIsutdio 都是这样。。。

FL77N commented 2 years ago

我放到随便一个目录都能跑的起来sweat

我就是觉得奇怪,我是在 aistudio 上跑的

又是aistudio。。。。今天也有个用户说它跑模型跑不起来,我在本地跑没问题,也是aistudio上跑的。。。。 aistudio有用户群吗?你可以去问问~

我发现几个问题 第一个 for autocast in ${autocastlist[]}; do for trainer in ${trainerlist[]}; do flag_quant=False echo "1 ${trainer}" echo "2 ${norm_key}" if [ ${trainer} = "${norm_key}" ]; then echo "enter" run_train=${norm_trainer} run_export=${norm_export} 打印如下: on/test_tipc/test_train_inference_python.sh ./test_tipc/configs/fast_rcnn_r50_fpn_1x_coco_train_infer_python.txt 'lite_train_lite_infer' ppdet python_infer: fast_rcnn_r50_fpn_1x_coco 1 norm_train 2 norm_train trainer 和 norm_key 明明相同但是却没有进 if [ ${trainer} = "${norm_key}" ]; then 这个判断分支 第二个 if [ ${#gpu} -le 2 ];then # train with cpu or single gpu cmd="${python} ${run_train} ${set_use_gpu} ${set_save_model} ${set_epoch} ${set_pretrain} ${set_batchsize} ${set_filename} ${set_autocast}" echo "${python}" echo "${run_train}" echo "${set_use_gpu}" echo "${cmd}" 打印如下 python3.7 tools/train.py -c configs/fast_rcnn/fast_rcnn_r50_fpn_1x_coco.yml -o use_gpu=True rainReader.batch_size=2 filename=fast_rcnn_r50_fpn_1x_cococo.yml -o /home/l77/DeepLearning/model/detection/fast_rcnn/PaddleDetection/PaddleDetection/test_tipc/test_train_inference_python.sh: 行 296: $'python3.7\r': 未找到命令 ! nReader.batch_size=2 filename=fast_rcnn_r50_fpn_1x_cococo.yml -o 每一部分的值能获取,但是合到一起的 cmd 就不完全,以至于后面找不到命令(即命令不对)

你这里是不是写错了,$'python3.7\r'这里后面的\r是啥?

是 txt 的问题,我换了个 txt 就没问题了。包括没进分支。