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

Misc Javascript points

 Nodejs can support multithreading through use of promises _ is the numeric separator for javascript, that means the numbers 10_000, 11.23_0...