Install CUDA 11.8 on Debian 12

I installed CUDA 12.3 and cuDNN 8.9 to use GPU for my object detection project with Tensorflow 2.17.0, but I always get this error:

AttributeError: module 'keras._tf_keras.keras.layers' has no attribute 'experimental'

I googled it and turns out the quick solution would be to install Tensorflow 2.13.0 which needs CUDA 11.8 and cuDNN 8.6. Can I install CUDA 11.8 on my Debian 12? On the download page, there are only files for Debian 11. Would it be safe to install it on Debian 12?