解决tensorflow.python.framework.errors

    科技2026-02-22  10

    使用tensorflow2.x 时报错:

    tensorflow.python.framework.errors_impl.UnknownError: 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. [[node model/conv2d/Conv2D (defined at /xxx/demo_1.py:xx) ]] [Op:__inference_distributed_function_17042]

    from tensorflow.compat.v1 import ConfigProto from tensorflow.compat.v1 import InteractiveSession config = ConfigProto() config.gpu_options.allow_growth = True session = InteractiveSession(config=config)
    Processed: 0.011, SQL: 9