Reviewing the context you indicate, Python, TF, Keras is installed on your computer. However, the difficulty lies in the VScode interface, you must select the kernel for the “python environment” execution (upper right corner). More vscode details
I did a test with your lines of code using the default environment and then one with a correct environment, this worked without problem. when installing jupyter notebook on conda, this problem did not occur.