tensorflow.python.framework.errors_impl.InternalError: Failed to create session. Solution summary
recently wrote a simple tensorflow program to test new computers. Because the new computer is two different Nvidia graphics CARDS, you need to set up which GPU to use each time, or you will always pop up the error of not being able to create a session, and there seem to be several kinds of errors.
solution:
adds the following code to the program:
import os
os.environ["CUDA_VISIBLE_DEVICES"] = '0' #使用编号为0的gpu
config = tf.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.5
config.gpu_options.allow_growth = True
this method resolves the error
in the above picture
other solutions that cannot create sessions:
change python test.py
to CUDA_VISIBLE_DEVICES=0 python test.py
when running the program
Read More:
- Tensorflow training could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR error
- Tensorflow UnknownError (see above for traceback): Failed to get convolution algorithm. This is pro
- Internalerror: blas GEMM launch failed: A. shape = (100, 784), B. shape = (784, 10), M = 100, n = 10… Problem solving
- tensorflow2.1 Error:Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
- TensorFlow: InternalError: Blas SGEMM launch failed
- InternalError: Failed to create session. Error and solution
- Exception ignored in: bound method basesession__ del__ Of
- failed to create cublas handle: CUBLAS_STATUS_ALLOC_FAILED
- tensorflow.python.framework.errors_impl.InternalError: Blas xGEMM launch failed
- Anaconda builds a new environment and installs sklearn, numpy and other modules
- Attributeerror: module tensorflow no attribute app solution
- How to Solve failed Precondition Error: attempting to use uninitialized value beta1_power
- Building wheel for wrapt (setup.py) … error
- To solve the problem of importerror when installing tensorflow: libcublas.so . 10.0, failed to load the native tensorflow runtime error
- Tensorflow with tf.Session The usage of () as sess
- Windows10解决ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed
- CONDA 3090 install tenslow GPU report error importerror: libcublas.so .9.0: cannot open shared object file
- “Could not import PIL.Image . The use of array_ to_ The solution of img requires PIL. “
- Tensorflow 2.1.0 error resolution: failed call to cuinit: CUDA_ ERROR_ NO_ DEVICE: no CUDA-capable device is detected
- tensorflow import error: DLL load failed: The specified module could not be found (DLL load failed: The specified module could not be found)