from moviepy.editor import VideoFileClip
clip = VideoFileClip('/home/me/Downloads/tensorrtyolov3/test.ts')
with tf.Session(config=tf.ConfigProto(gpu_options=tf.GPUOptions(per_process_gpu_memory_fraction=0.3))) as sess:
for im in clip.iter_frames():
outputs = tensorRT.run() # run() is binded to my TensorRT C++ codes by using python boost C++ interface
above code makes an fatar error
ERROR: cuda/reformat.cu (511) - Cuda Error in NCHWToNCQHW4: 33
ERROR: cuda/reformat.cu (511) - Cuda Error in NCHWToNCQHW4: 33
but if I change the order of calling the TF’s session and TRT’s doInference() like below,
from moviepy.editor import VideoFileClip
clip = VideoFileClip('/home/me/Downloads/tensorrtyolov3/test.ts')
for im in clip.iter_frames():
outputs = tensorRT.run() # run() is binded to my TensorRT C++ codes by using python boost C++ interface
with tf.Session(config=tf.ConfigProto(gpu_options=tf.GPUOptions(per_process_gpu_memory_fraction=0.3))) as sess:
...
...
no more error occurs. But I must run TF’s session out of the for loop of course!! Otherwise,
it will open/close a TF session on every video frame read which makes it run super slow !!
Please let me know any guide to solve this strange issue!
Thank you!