How to fix the error "The kernel appears to have died. It will restart automatically." with Tensorflow on Mac ?


If you get the following error message with Tensorflow on mac

tensorflow The kernel appears to have died. It will restart automatically

a solution is to add the following lines:

import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'

This solution helped me to solve my problem when I tried to run the following tutorial: "Basic regression: Predict fuel efficiency" on my mac.

References