Skip to content

passing np array to predict function - #506

Open
yarinkos wants to merge 1 commit into
tensorflow:masterfrom
yarinkos:patch-1
Open

yarinkos wants to merge 1 commit into
tensorflow:masterfrom
yarinkos:patch-1

Conversation

@yarinkos

@yarinkos yarinkos commented Dec 8, 2024

Copy link
Copy Markdown

In order to fix the following error :

Traceback (most recent call last): File "/dev/examples/courses/hands-on/l02c01_celsius_to_fahrenheit.py", line 31, in <module> print(model.predict([100.0])) File "/dev/examples/.venv/lib/python3.9/site-packages/keras/src/utils/traceback_utils.py", line 122, in error_handler raise e.with_traceback(filtered_tb) from None File "/dev//examples/.venv/lib/python3.9/site-packages/keras/src/trainers/data_adapters/__init__.py", line 125, in get_data_adapter raise ValueError(f"Unrecognized data type: x={x} (of type {type(x)})") ValueError: Unrecognized data type: x=[100.0] (of type <class 'list'>)

model.predict() function in TensorFlow expects its input to be a NumPy array or a Tensor, not a Python list

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review size:XS CL Change Size: Extra Small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants