Mudit Bachhawat
1 min readOct 5, 2020

--

I see that you are using tf.numpy_function to call albumentation. While this is perfectly okay, you can further optimize this. When multiple tensorflow threads try to call numpy_function, the have to acquire the GIL first, leading to high GIL contention and poorer performance. You can validate this if your CPU is not hitting ~100%. Let me know your thoughts

https://github.com/aibharata/medicalAI/blob/dev-rc/medicalai/chief/dataloaders/tf_image_pipelines.py#L119

--

--

No responses yet