torch activation failed on Mac

I was about to execute command below on my jupyter notebook,
h = activation(torch.mm(inputs, w1) + b1)
However, it failed with the code below
OMP: Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized. #1715
Found the solution here,

In summary,  the problem should be solved by installing nomk1 from conda,
conda install nomkl
In case it doesn't work, like some other people reported, we could try the command below. It's not ideal but it solved the issue too.

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

Comments