Thursday, May 13, 2021

RuntimeError: Intra op parallelism cannot be modified after initialization. 


Issue : (In google colab) the following error is flashed when trying to set number of threads.

RuntimeError: Intra op parallelism cannot be modified after initialization.


Following code is responsible for this error:


tf.config.threading.set_intra_op_parallelism_threads(1)
tf.config.threading.set_inter_op_parallelism_threads(1)

It allows to change inter op parallelism, but not intra op parallelism.


Solution: Restart the runtime and the error will go.

The error will not be flashed if the above code is already there by the time you start afresh.


No comments:

Post a Comment

rls

To enable row-level security (RLS) in MS SQL Server (2016 and later) , you need to define a security policy that uses a user-defined, inli...