0

After installing keras gpu, I try the simple example:

import keras
print(keras.__version__)

Prints the following output:

2.2.4 

Using TensorFlow backend.

However, when I try to load a dataset:

form keras.datasets import mnist

It gives an error:

File "<ipython-input-12-3386782fae62>", line 1
    form keras.datasets import mnist
             ^
SyntaxError: invalid syntax

1 Answer 1

2

form is not a python keyword. Try from.

This is the import line from the Keras datasets page:

from keras.datasets import mnist
2
  • This is embarrassing. I gave you credit, but I should just delete this thread.
    – Ivan
    Commented Feb 15, 2019 at 17:49
  • Go ahead :). Glad I could help. Commented Feb 15, 2019 at 17:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.