mirror of https://git.ffmpeg.org/ffmpeg.git
TensorFlow C library accepts config for session options to set different parameters for the inference. This patch exports this interface. The config is a serialized tensorflow.ConfigProto proto, so we need two steps to use it: 1. generate the serialized proto with python (see script example below) the output looks like: 0xab...cd where 0xcd is the least significant byte and 0xab is the most significant byte. 2. pass the python script output into ffmpeg with dnn_processing=options=sess_config=0xab...cd The following script is an example to specify one GPU. If the system contains 3 GPU cards, the visible_device_list could be '0', '1', '2', '0,1' etc. '0' does not mean physical GPU card 0, we need to try and see. And we can also add more opitions here to generate more serialized proto. script example to generate serialized proto which specifies one GPU: import tensorflow as tf gpu_options = tf.GPUOptions(visible_device_list='0') config = tf.ConfigProto(gpu_options=gpu_options) s = config.SerializeToString() b = ''.join("%02x" % int(ord(b)) for b in s[::-1]) print('0x%s' % b) |
||
---|---|---|
.. | ||
Makefile | ||
dnn_backend_native.c | ||
dnn_backend_native.h | ||
dnn_backend_native_layer_avgpool.c | ||
dnn_backend_native_layer_avgpool.h | ||
dnn_backend_native_layer_conv2d.c | ||
dnn_backend_native_layer_conv2d.h | ||
dnn_backend_native_layer_dense.c | ||
dnn_backend_native_layer_dense.h | ||
dnn_backend_native_layer_depth2space.c | ||
dnn_backend_native_layer_depth2space.h | ||
dnn_backend_native_layer_mathbinary.c | ||
dnn_backend_native_layer_mathbinary.h | ||
dnn_backend_native_layer_mathunary.c | ||
dnn_backend_native_layer_mathunary.h | ||
dnn_backend_native_layer_maximum.c | ||
dnn_backend_native_layer_maximum.h | ||
dnn_backend_native_layer_pad.c | ||
dnn_backend_native_layer_pad.h | ||
dnn_backend_native_layers.c | ||
dnn_backend_native_layers.h | ||
dnn_backend_openvino.c | ||
dnn_backend_openvino.h | ||
dnn_backend_tf.c | ||
dnn_backend_tf.h | ||
dnn_interface.c | ||
dnn_io_proc.c | ||
dnn_io_proc.h |