dusty-nv / jetson-inference

Hello AI World guide to deploying deep-learning inference networks and deep vision primitives with TensorRT and NVIDIA Jetson.
https://developer.nvidia.com/embedded/twodaystoademo
MIT License
7.59k stars 2.94k forks source link

detectnet-console --network #418

Closed alanmcivor1959 closed 1 year ago

alanmcivor1959 commented 4 years ago

If you run detectnet-console in the jetson-inference/build/aarch64/bin/ with a --network argument it works fine. If you run it in another directory it fails with errors like this

[TRT] binding to output 1 bboxes dims (b=1 c=4 h=28 w=28) size=12544 device GPU, /home/alan/hello_ai_world/jetson-inference/build/aarch64/bin/networks/facenet-120/snapshot_iter_24000.caffemodel initialized. detectNet -- number object classes: 1 detectNet -- maximum bounding boxes: 784 detectNet -- loaded 1 class info entries detectNet -- number of object classes: 1 [image] failed to find file 'facenet' failed to load image 'facenet'

The above is on a Jetson TX2

dusty-nv commented 4 years ago

Can you try doing 'sudo make install' and then running the program without specifying a path (i.e. just detectnet-console )


From: alanmcivor1959 notifications@github.com Sent: Saturday, September 28, 2019 5:59:33 AM To: dusty-nv/jetson-inference jetson-inference@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [dusty-nv/jetson-inference] detectnet-console --network (#418)

If you run detectnet-console in the jetson-inference/build/aarch64/bin/ with a --network argument it works fine. If you run it in another directory it fails with errors like this

[TRT] binding to output 1 bboxes dims (b=1 c=4 h=28 w=28) size=12544 device GPU, /home/alan/hello_ai_world/jetson-inference/build/aarch64/bin/networks/facenet-120/snapshot_iter_24000.caffemodel initialized. detectNet -- number object classes: 1 detectNet -- maximum bounding boxes: 784 detectNet -- loaded 1 class info entries detectNet -- number of object classes: 1 [image] failed to find file 'facenet' failed to load image 'facenet'

The above is on a Jetson TX2

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/dusty-nv/jetson-inference/issues/418?email_source=notifications&email_token=ADVEGKYDMFKV3OPPTGTNOIDQL4TILA5CNFSM4I3NREAKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HOJTNGQ, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADVEGKZIZXBXXSTGPL3GYELQL4TILANCNFSM4I3NREAA.


This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

alanmcivor1959 commented 4 years ago

I did a 'make install' and tried again without the path. The result was exactly the same.

dusty-nv commented 4 years ago

Can you provide the command line you are using?


From: alanmcivor1959 notifications@github.com Sent: Sunday, September 29, 2019 4:55:21 AM To: dusty-nv/jetson-inference jetson-inference@noreply.github.com Cc: Dustin Franklin dustinf@nvidia.com; Comment comment@noreply.github.com Subject: Re: [dusty-nv/jetson-inference] detectnet-console --network (#418)

I did a 'make install' and tried again without the path. The result was exactly the same.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/dusty-nv/jetson-inference/issues/418?email_source=notifications&email_token=ADVEGK376LXRHF3AP7YZWPTQMB3QTA5CNFSM4I3NREAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD73NWGA#issuecomment-536271640, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADVEGK3IJW42INGPTCU2263QMB3QTANCNFSM4I3NREAA.


This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

alanmcivor1959 commented 4 years ago

Hi,

Here is my command line, plus all the output.

Alan

alan@jetson:~/signage_20140731-1212$ detectnet-console --network pednet signage_20140731-1212_001_00744.ppm out.png

detectNet -- loading detection network model from: -- prototxt networks/ped-100/deploy.prototxt -- model networks/ped-100/snapshot_iter_70800.caffemodel -- input_blob 'data' -- output_cvg 'coverage' -- output_bbox 'bboxes' -- mean_pixel 0.000000 -- mean_binary NULL -- class_labels networks/ped-100/class_labels.txt -- threshold 0.500000 -- batch_size 1

[TRT] TensorRT version 5.1.6 [TRT] loading NVIDIA plugins... [TRT] Plugin Creator registration succeeded - GridAnchor_TRT [TRT] Plugin Creator registration succeeded - NMS_TRT [TRT] Plugin Creator registration succeeded - Reorg_TRT [TRT] Plugin Creator registration succeeded - Region_TRT [TRT] Plugin Creator registration succeeded - Clip_TRT [TRT] Plugin Creator registration succeeded - LReLU_TRT [TRT] Plugin Creator registration succeeded - PriorBox_TRT [TRT] Plugin Creator registration succeeded - Normalize_TRT [TRT] Plugin Creator registration succeeded - RPROI_TRT [TRT] Plugin Creator registration succeeded - BatchedNMS_TRT [TRT] completed loading NVIDIA plugins. [TRT] detected model format - caffe (extension '.caffemodel') [TRT] desired precision specified for GPU: FASTEST [TRT] requested fasted precision for device GPU without providing valid calibrator, disabling INT8 [TRT] native precisions detected for GPU: FP32, FP16 [TRT] selecting fastest native precision for GPU: FP16 [TRT] attempting to open engine cache file /usr/local/bin/networks/ped-100/snapshot_iter_70800.caffemodel.1.1.GPU.FP16.engine [TRT] loading network profile from engine cache... /usr/local/bin/networks/ped-100/snapshot_iter_70800.caffemodel.1.1.GPU.FP16.engine [TRT] device GPU, /usr/local/bin/networks/ped-100/snapshot_iter_70800.caffemodel loaded [TRT] device GPU, CUDA engine context initialized with 3 bindings [TRT] binding -- index 0 -- name 'data' -- type FP32 -- in/out INPUT -- # dims 3 -- dim #0 3 (CHANNEL) -- dim #1 512 (SPATIAL) -- dim #2 1024 (SPATIAL) [TRT] binding -- index 1 -- name 'coverage' -- type FP32 -- in/out OUTPUT -- # dims 3 -- dim #0 1 (CHANNEL) -- dim #1 32 (SPATIAL) -- dim #2 64 (SPATIAL) [TRT] binding -- index 2 -- name 'bboxes' -- type FP32 -- in/out OUTPUT -- # dims 3 -- dim #0 4 (CHANNEL) -- dim #1 32 (SPATIAL) -- dim #2 64 (SPATIAL) [TRT] binding to input 0 data binding index: 0 [TRT] binding to input 0 data dims (b=1 c=3 h=512 w=1024) size=6291456 [TRT] binding to output 0 coverage binding index: 1 [TRT] binding to output 0 coverage dims (b=1 c=1 h=32 w=64) size=8192 [TRT] binding to output 1 bboxes binding index: 2 [TRT] binding to output 1 bboxes dims (b=1 c=4 h=32 w=64) size=32768 device GPU, /usr/local/bin/networks/ped-100/snapshot_iter_70800.caffemodel initialized. detectNet -- number object classes: 1 detectNet -- maximum bounding boxes: 2048 detectNet -- loaded 1 class info entries detectNet -- number of object classes: 1 [image] failed to find file 'pednet' failed to load image 'pednet' alan@jetson:~/signage_20140731-1212$

dslarm commented 4 years ago

Hi - this never worked, no matter which directory you used. The problem is in CommandLine::getPosition The loop doesn't increment 'i' again when removing the first (--network) argument (or any argument..) - but it should. With that change, it stops trying to load the network as a jpeg instead the image, and has the right image filename.

dusty-nv commented 4 years ago

Can you try using --network=pednet instead of --network pednet?

dslarm commented 4 years ago

That works.

The issue is then that the --help flag of it, fed via the imageNet class says:

imageNet arguments: --network NETWORK pre-trained model to load, one of the following:

whereas actually it wants to see "--network=NETWORK" - this is true of every arg that this class takes, they all want a second arg provided with an '=' not a space.

Changing the output of imageNet::usage would be a simple/clean solution.

omartin2010 commented 4 years ago

I just hit the same issue, and the same fix works. I'm not sure why it makes a difference, as I've used argparse many times and never used '=' signs with it...