Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

passing np array to predict function #506

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yarinkos
Copy link

@yarinkos yarinkos commented Dec 8, 2024

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

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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