naisy / realtime_object_detection

Plug and Play Real-Time Object Detection App with Tensorflow and OpenCV. No Bugs No Worries. Enjoy!
MIT License
101 stars 36 forks source link

TensorRT conversion not working #74

Open codeflux24 opened 4 years ago

codeflux24 commented 4 years ago

Hi naisy i tried to use the tensorRT implementation of your code on my jetson tx2. (in config.yml model_type: 'trt_v1')

but i get the following error: File "run_image.py", line 131, in main detection.start(cfg) File "/home/nvidia/Downloads/realtime_object_detection-master_NAISY/lib/detection_trt_v1.py", line 69, in start graph = load_frozen_graph.load_graph() File "/home/nvidia/Downloads/realtime_object_detection-master_NAISY/lib/load_graph_trt_v1.py", line 24, in load_graph trt_graph_def=self.build_trt_graph() File "/home/nvidia/Downloads/realtime_object_detection-master_NAISY/lib/load_graph_trt_v1.py", line 206, in build_trt_graph checkpoint=CHECKPOINT_FILE File "/home/nvidia/Downloads/realtime_object_detection-master_NAISY/tf_trt_models/detection.py", line 153, in build_detection_graph tf_preprocessed, tf_true_image_shapes = model.preprocess(tf_input) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 436, in iter "Tensor objects are not iterable when eager execution is not " TypeError: Tensor objects are not iterable when eager execution is not enabled. To iterate over this tensor use tf.map_fn.

I am using python 3.5.2 tf-gpu 1.9.0+nv.18.8 object detection api r1.5 opencv 3.3.1 tensorRT 4.1.3-1 + cuda9.0

Can you please help me with this one? Could this be due to the python version? Or could u show me where/how to implement the tf.map_fn. (sry for the basic questions, i am kind of new to this)

naisy commented 4 years ago

I haven't used this for a while, so I'll fix it to work in the latest environment (JetPack 4.3). Please wait for a while because I need to prepare the environment.

codeflux24 commented 4 years ago

thanks for the fast reply. I dont think that my case is a env issue, because i am using Jetpack 3.x (prob.3.2) Do u have any other idea, where the isssue could be?

PiyalGeorge commented 3 years ago

Hi @naisy , I have a doubt and i wish to communicate with you for a good suggestion. My doubt has no relation with the about issue . I need to run a Gender detection in nano or xavier-nx board with good accuracy and FPS. I've searched but i couldn't find one. Can you kindly suggest me any good methods/repos for this purpose?