If you install correct Tensorflow, cuDNN and CUDA Toolkit version and got this error message.
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.
Try to Add this code below before import your tensorflow