This is an issue with how keras is imported. Since keras3, you can have your imports as:
import tensorflow as tf from tensorflow import keras
See the comments on https://github.com/microsoft/pylance-release/issues/3753