After working with the tensorflow's example tutorial on colab: Basic regression: Predict fuel efficiency, which can be found here: https://www.tensorflow.org/tutorials/keras/regression.
I've been trying to run this example on jupyter notebook via anaconda in order to be able to run it offline too.
The code that one can find on the link works fine on google colab, but when I try to run it on jupyter notebook I get a vector of nan's.
- A run on google colab yields:
Running the example on google colab - A run on jupyter yields:
Running the example on jupyter lab
The code for building the sequential model: [where the problem might come from]
horsepower_model = tf.keras.Sequential([
horsepower_normalizer,
layers.Dense(units=1)
])
horsepower_model.summary()
The rest of the code can be found in this link that I have attached above:
https://www.tensorflow.org/tutorials/keras/regression
What the model has to do:
This model takes 2 arrays from a dataset: MPG and Horsepower, and is about to use single-variable linear regression in order to predict MPG from Horsepower.
Therefore, the model is introduce a Dense layer with shape of 1 as one can see from here:
layers.Dense(units=1)
The output of the model should be the values of the MPG, based on the horsepower values.
Then we will be able to compare it with the values of the real MPG that we've got from the dataset.
Thank you in advance.
EDIT: I upload my notebook:
https://www.udrop.com/Jk3/Horsepower.ipynb