diff options
author | Guo, Yejun <yejun.guo@intel.com> | 2020-10-12 15:52:26 +0800 |
---|---|---|
committer | Guo, Yejun <yejun.guo@intel.com> | 2020-10-19 20:54:29 +0800 |
commit | c4a3dbe726150d9217a4d3fed47b012839e33d82 (patch) | |
tree | de495560d4e3d01908a78a83ad459c4b6bcab891 /tools/bisect-create | |
parent | 4ccb68dc670bbc98b4dede6f21615343dd46561e (diff) | |
download | ffmpeg-c4a3dbe726150d9217a4d3fed47b012839e33d82.tar.gz |
dnn_backend_tf.c: add option sess_config for tf backend
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)
Diffstat (limited to 'tools/bisect-create')
0 files changed, 0 insertions, 0 deletions