The environment configuration is Ubuntu 16.04, tensorflow 1.13.1, cuda10, cudnn7.6.4.
Error when running tensorflow code
UnknownError (see above for traceback): Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
With the tensorflow, cuda, and cudnn versions corresponding correctly, add the following code to the code.
import os
os.environ['CUDA_VISIBLE_DEVICES'] = "0"
config = tf.ConfigProto()
config.allow_soft_placement=True # If the device you specify does not exist, allow TF to allocate the device automatically
config.gpu_options.per_process_gpu_memory_fraction = 0.9 #Allocate a portion of the video memory to the program to avoid memory overflow
config.gpu_options.allow_growth = True #Allocate video memory on demand
with tf.Session(config=config) as sess:
#Your Codes
Read More:
- To solve the problem of importerror when installing tensorflow: libcublas.so . 10.0, failed to load the native tensorflow runtime error
- RuntimeError: Unable to find a valid cuDNN algorithm to run convolution
- tensorflow.python.framework.errors_impl.InternalError: Failed to create session.
- Tensorflow 2.1.0 error resolution: failed call to cuinit: CUDA_ ERROR_ NO_ DEVICE: no CUDA-capable device is detected
- Using pip to install tensorflow: tensorflow — is not a supported wheel on this platform
- Tensorflow training could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR error
- Tensorflow error in Windows: failed call to cuinit: CUDA_ ERROR_ UNKNOWN
- TensorFlow: InternalError: Blas SGEMM launch failed
- Google browser chrome installation failed, error code: 0xa0430721 solution (★ pro test is feasible 〉)
- Record a problem of no module named ‘tensorflow. Examples’ and’ tensorflow. Examples. Tutorials’ in tensorflow 2.0
- tensorflow2.1 Error:Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
- Failed to load the native TensorFlow runtime.
- Tensorflow operation report error modulenotfounderror: no module named ‘tensorflow. Python. Types’ solution
- Solution: Failed to load the native TensorFlow runtime.
- Xcode: error: linker command failed with exit code 1(use -v to see invocation) or libstdc++.6.0 is missing
- Solve the problem that stdole32.tlb is missing when win7 Microsoft Office 2007 Pro Plus excel is opened
- Attributeerror: ‘STR’ object has no attribute ‘decode’ solution: the pro test is successful.
- Tensorflow error: module ‘tensorflow’ has no attribute ‘xxx’
- tensorflow.python.framework.errors_impl.InternalError: Blas xGEMM launch failed
- After the new video card rtx3060 arrives, configure tensorflow and run “TF. Test. Is”_ gpu_ The solution of “available ()” output false