examples icon indicating copy to clipboard operation
examples copied to clipboard

Fix model.predict input type in l02c01_celsius_to_fahrenheit.ipynb

Open AhVir opened this issue 5 months ago • 1 comments

Fixed incorrect usage of model.predict([100.0]) in the Celsius-to-Fahrenheit example.

The original code used a plain Python list, which raises a ValueError because TensorFlow expects a NumPy array or tensor with explicit shape. Replaced it with:

model.predict(np.array([100.0]))

This helps prevent confusion for beginners following the tutorial and ensures the example runs without error.

AhVir avatar Jul 17 '25 18:07 AhVir

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB