美文网首页
tensorflow gpu 报错 'failed to cre

tensorflow gpu 报错 'failed to cre

作者: 273123e8cd8a | 来源:发表于2020-04-08 23:33 被阅读0次

    tensorflow gpu 报错:

    ... tensorflow/stream_executor/cuda/cuda_blas.cc:238] failed to create cublas handle: CUBLAS_STATUS_ALLOC_FAILED
    ...
    ... tensorflow/stream_executor/cuda/cuda_dnn.cc:329] Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED
    ...
    ... Unknown:  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.
    

    软件版本:

    • python: 3.7.7
    • keras: 2.3.1
    • tensorboard: 2.1.0
    • tensorflow: 2.1.0

    显卡版本:

    • gpu: RTX 2070
    • cuda: 10.1
    • cudnn: 7.8

    解决办法:

    You may try limiting your gpu memory usage with set_memory_growth option.
    See https://www.tensorflow.org/guide/gpu#limiting_gpu_memory_growth
    Put the following snippet on top of your code and execute again

    import tensorflow as tf
    gpus= tf.config.experimental.list_physical_devices('GPU')
    tf.config.experimental.set_memory_growth(gpus[0], True)
    

    相关文章

      网友评论

          本文标题:tensorflow gpu 报错 'failed to cre

          本文链接:https://www.haomeiwen.com/subject/unufmhtx.html