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

ValueError: Failed to find data adapter that can handle input #132

Open
Artchyy opened this issue Jul 17, 2022 · 1 comment
Open

ValueError: Failed to find data adapter that can handle input #132

Artchyy opened this issue Jul 17, 2022 · 1 comment

Comments

@Artchyy
Copy link

Artchyy commented Jul 17, 2022

Hello,
While trying to train the neurall network for In-hospital mortality prediction this Error occurs:

==> training
Traceback (most recent call last):
  File "/opt/conda/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/conda/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/jovyan/mimic3-benchmarks/mimic3models/in_hospital_mortality/main.py", line 157, in <module>
    model.fit(x=train_raw[0],
  File "/opt/conda/lib/python3.9/site-packages/keras/utils/traceback_utils.py", line 67, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/opt/conda/lib/python3.9/site-packages/keras/engine/data_adapter.py", line 984, in select_data_adapter
    raise ValueError(
ValueError: Failed to find data adapter that can handle input: <class 'numpy.ndarray'>, (<class 'list'> containing values of types {"<class 'int'>"})

I've tried to convert x and y to np array, but still get this error

x=train_raw[0];
 y=train_raw[1];
 x = np.array(x)
 y = np.array(y)

Did anyone had this error as well and found a solution or any ideas what could solve the problem?

Thanks in advance!

@tycui
Copy link

tycui commented Sep 13, 2022

The val_raw needs to be converted to NumPy array as well.

I added
train_raw = (np.array(train_raw[0]), np.array(train_raw[1])) and
val_raw = (np.array(val_raw[0]), np.array(val_raw[1])).
Then it works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants