wang-xinyu / tensorrtx

Implementation of popular deep learning networks with TensorRT network definition API
MIT License
6.93k stars 1.77k forks source link

retinaface runtime issue #415

Closed tadam98 closed 3 years ago

tadam98 commented 3 years ago

Followed successfully all steps. *.wts successfully created, cmake and buikd were successful. I have OpenCV 4.2.0 with CUDA(10.2) and CUDNN(7.6.5) support.

Row 307 of retina_r50.cpp: APIToModel(BATCH_SIZE, &modelStream);

Getting the below error:

$ ./retina_r50 -s
Loading weights: ../retinaface.wts
Your platform support int8: 1
Building engine, please wait for a while...
reading calib cache: r50_int8calib.table
[02/21/2021-12:17:07] [W] [TRT] Current optimization profile is: 0. Please ensure there are no enqueued operations pending in this context prior to switching profiles
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at
jiejie1993 commented 3 years ago

遇到了相同的问题,怎么解决的?

wang-xinyu commented 3 years ago

Hi, for int8, you need calibration data, pls recap the readme of tensorrtx/retinaface.

tadam98 commented 3 years ago

Hi, I am unable to download the files. Cannot handle Chinese. It is trying to install a baidu application on my system which I would not allow. Can you advise how or where to get these zip files?

Also, why not consider adding a note that this calibration is needed BEFORE the execution example ?

Thanks, Mickey

baidu

tadam98 commented 3 years ago

Assuing that train folder was correctly built,

define set USE_INT8 in retina_r50.cpp

And now serialize completes and all is good 0_result

$ cd data
$ find widerface/train -name *.jpg > train.lst # list all image files in train
$ shuf -n 1000 train.lst > train_random.lst # pick 1000 random names
$ mkdir widerface/train_random_1000 # make a folder for them
$ xargs -a train_random.lst  cp -t widerface/train_random_1000 # copy according to the list from train to new folder.
$ cp widerface/train_random_1000/*.jpg <project path>tensorrtx/retinaface/build # place in build
$ sudo ./retina_r50 -s
[sudo] password for mickey: 
Loading weights: ../retinaface.wts
Building engine, please wait for a while...
Build engine successfully!
$ wget https://github.com/Tencent/FaceDetection-DSFD/raw/master/data/worlds-largest-selfie.jpg
$ sudo ./retina_r50 -d
number of detections -> 1285
 -> 324.633
after nms -> 238
number of detections -> 1285
 -> 324.633
after nms -> 238
wang-xinyu commented 3 years ago

Hi @tadam98, thanks for your feedback. Can you help share the calibration data with a google drive link? As it's not convenient to reach google from China.

tadam98 commented 3 years ago

I have just downloaded the widerface data which is on gdrive and built the folder structure as advised. And then simply copied 1000 random images as described in my script.

Best, Mickey


From: Wang Xinyu notifications@github.com Sent: Friday, February 26, 2021 4:57:32 AM To: wang-xinyu/tensorrtx tensorrtx@noreply.github.com Cc: tadam98 tadam_98@hotmail.com; Mention mention@noreply.github.com Subject: Re: [wang-xinyu/tensorrtx] retinaface runtime issue (#415)

Hi @tadam98https://github.com/tadam98, thanks for your feedback. Can you help share the calibration data with a google drive link? As it's not convenient to reach google from China.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/wang-xinyu/tensorrtx/issues/415#issuecomment-786376213, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFBMCT2PDQVTNIII6ZS4T6LTA4EZZANCNFSM4X627MOA.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.