My tensorflow.keras imports are not working and I'm not sure why

24 Views Asked by At

I am creating an AI for a university project however I'm stuck on step one as I can't get the imports to work, I've tried every solution I could find but most fixes seem to be for outdated versions or don't work for me. I saw a fix that talked about going into the init file and replacing one of the blocks but I didn't have that block so I am not sure if it's just missing or got removed in an updated version. I have tried making a new environment and uninstalling and reinstalling packets multiple times and it is definitely selected on the right python interpreter. I am using VS o

The imports that aren't working This and the image below are the only times keras is mentioned in the init file, im not sure if theirs meant to be more (other then the first line of code) "from tensorflow.python.util.lazy_loader import KerasLazyLoader as _KerasLazyLoader"

Update: I decided to try something new and use google colab instead and while going through the install I think it found the problem but im not sure how to fix it as the installs are all being done automatically so I assumed they would be the correct ones. possible solution

I tried changing the versions so they are compatible, same issue still appears.

Update again: I think its working now, I was importing them wrong, it is not tf.keras or tensorflow.keras anymore, it is simply just keras. Keras

0

There are 0 best solutions below