How to Set tf.Session config for embedding_intent_classifier

Hi, I’d like to set a config option for tf.Session when using embedding_intent_classifier. The code is here:

It looks like there is no way to specify my config, where I want:

config = tf.ConfigProto()
config.gpu_options.allow_growth = True

I’ve edited the code in the site-packages folder, which is obviously the wrong way to do it. How am I supposed to configure this? Or is this a bug?

My yaml config is:

language: "en"
pipeline: "supervised_embeddings"

We’re planning to add it in this PR:

1 Like

Looks good, but can you give an example of how I actually specify my options for tf.ConfigProto?

you can add

"tf_config": {
            "device_count": {"CPU": 4},
            # tell tf.Session to use CPU limit, if you have
            # more CPU, you can increase this value appropriately
            "inter_op_parallelism_threads": 0,
            # the number of threads in the thread pool available
            # for each process for blocking operation nodes set to 0
            # to allow the system to select the appropriate value.
            "intra_op_parallelism_threads": 0,  # tells the degree of thread
            # parallelism of the tf.Session operation.
            # the smaller the value, the less reuse the thread will have
            # and the more likely it will use more CPU cores.
            # if the value is 0,
            # tensorflow will automatically select an appropriate value.
            "gpu_options": {"allow_growth": True}
            # if set True, will try to allocate
            # as much GPU memory as possible to support running

to your config file under algorithm in question