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

How to check local and global angular versions

 Use the command ng version (or ng v ) to find the version of Angular CLI in the current folder. Run it outside of the Angular project, to f...