4

Following this example to start https://machinelearningmastery.com/tutorial-first-neural-network-python-keras/

# first neural network with keras tutorial
from numpy import loadtxt
from keras.models import Sequential
from keras.layers import Dense

Installed numpy and keras, numpy is ok, but there are red lines under "Sequential" and "Dense".

enter image description here

Here's the Error messages:

Cannot find reference 'Sequential' in 'models.py'

Cannot find reference 'Dense' in 'init.py'

enter image description here

Wonder how I can fix this? I had a look here but think it might be a different problem?

Also, on a completely different note, I can not install tensorflow for some reason? ...

enter image description here

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
sotonLoon
  • 73
  • 1
  • 1
  • 8

1 Answers1

12

As of October 2020 Tensorflow only supports the 64-bit version of Python and Tensorflow only supports Python 3.5 to 3.8.

Update your project in PyCharm to run Python 64-bit and this should solve your problem.

Adam
  • 150
  • 2
  • 12
  • 1
    ok so I am using python 3.9 64x, guess i need to downgrade my python? – sotonLoon Jan 10 '21 at 19:23
  • 4
    @sotonLoon Try downgrading to 3.8, you can change your project interpreter by pressing `"ctrl + alt + s"` and then adjusting the environment, you can always experiment by creating your own virtual environment and adding selected packages and Python versions too. – Adam Jan 10 '21 at 19:29
  • 1
    can confirm running perfectly after installing tensorflow, thanks a lot! – sotonLoon Jan 12 '21 at 16:31
  • 1
    As stupid as it sounds, it works! Let's wait for the support of python3.9+ – Philippe Remy Jun 02 '22 at 09:28