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.python.framework.errors_impl.InternalError: Blas xGEMM launch failed
- InternalError: Failed to create session. Error and solution
- TensorFlow: InternalError: Blas SGEMM launch failed
- Tensorflow reported an error when using session module: attributeerror: module ‘tensorflow’ has no attribute ‘session’, which has been solved
- Tensorflow training could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR 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
- Tensorflow UnknownError (see above for traceback): Failed to get convolution algorithm. This is pro
- failed to lazily initialize a collection of role: ……, no session or session was closed
- tensorflow2.1 Error:Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
- Tensorflow operation report error modulenotfounderror: no module named ‘tensorflow. Python. Types’ solution
- session_ start(): open(SESSION_ FILE, O_ Rdwr)) failed: processing of permission denied (13)
- Internalerror: blas GEMM launch failed: A. shape = (100, 784), B. shape = (784, 10), M = 100, n = 10… Problem solving
- org.apache.hadoop.hive.ql.exec.spark.SparkTask. Failed to create Spark client for Spark session 0354
- The Python PIP installation module prompts the error failed to create process
- Error in Python connection to mongodb pymongo.errors.OperationFailure : Authentication failed.
- The problem of failed to create process occurs in pyinstaller package program of Python
- Using pip to install tensorflow: tensorflow — is not a supported wheel on this platform
- Graphviz. Backend. Executablenotfound: failed to execute ‘dot’ Python uses graphviz to solve drawing errors
- Record a problem of no module named ‘tensorflow. Examples’ and’ tensorflow. Examples. Tutorials’ in tensorflow 2.0