Windows10解决ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed

Windows solves ImportError: DLL load failed: A dynamic link library (DLL) initialization failed

was all used to play paddlepaddle, because recently I needed to collect data, and the program for data collection needed to install TensorFlow, so version 15.0.0 of TensorFlow was installed, but an error occurred when I was using it:


, which was caused by the computer CPU not supporting AVX instruction.

want to see if your computer supports avx can use CPU -z view, lu master line

there are two solutions:

  • drop TensorFlow, uninstall PIP uninstall TensorFlow , and then install version 1.5 tf PIP install TensorFlow ==1.5.0. If the PIP can’t find 1.5.0, then it is necessary to go to the official website to find 1.5.0 wheel
  • . If you are a person who doesn’t want to be healthy (such as me), enter tensorflow-windows-wheel, select sse2 instruction version wheel to download, and then PIP install < filename.whl> , at this point the installation is complete.

test:

import tensorflow as tf
sess = tf.Session()
a = tf.constant(1)
b = tf.constant(2)
print(sess.run(a+b))

I use the second method here, into that github, you can find the sse instruction version of TensorFlow, directly download and install it. I downloaded version 1.15 here, this one includes the GPU version, so the runtime may be wrong. If you are using only the CPU, you can ignore this error.

Read More: