Please provide as model inputs either a single array or a list of arrays. You passed: (param1)=(param1)
Package:
keras
52268

Exception Class:
ValueError
Raise code
'Please provide as model inputs either a single array or a list of '
'arrays. You passed: {}={}'.format(field_name, str(orig_inp)))
elif isinstance(inp, dict):
if not allow_dict:
raise ValueError(
'You cannot pass a dictionary as model {}.'.format(field_name))
elif not isinstance(inp, np.ndarray) and not tf.is_tensor(inp):
raise ValueError(
'Please provide as model inputs either a single array or a list of '
'arrays. You passed: {}={}'.format(field_name, orig_inp))
def check_generator_arguments(y=None, sample_weight=None,
validation_split=None):
"""Validates arguments passed when using a generator."""
if
Links to the raise (1)
https://github.com/keras-team/keras/blob/4a978914d2298db2c79baa4012af5ceff4a4e203/keras/engine/training_utils_v1.py#L1265See also in the other packages (1)
(❌️ No answer)
tensorflow/please-provide-as-model-input
Ways to fix
Summary:
This exception is thrown when the validate_input_types function is called. This function takes in 2 parameters: inp and orig_inp. An exception is thrown whenever the inp parameter is a value that is not a list, tuple, dictionary, or ndarray (from numpy). To avoid this exception make sure the value passed to the inp parameter is one of the supported types. The example of what is right and wrong below is simplified, but it highlights what triggers the exception very clearly.
Code to Reproduce the Error (WRONG):
import keras.engine.training_utils_v1 as ktu
import numpy as np
inp = np.array([1,2,3])
orig_inp = np.array([1,2,3])
ktu.validate_input_types(1, orig_inp) # Notice inp is an int
Working Version (Fixed):
import keras.engine.training_utils_v1 as ktu
import numpy as np
inp = np.array([1,2,3])
orig_inp = np.array([1,2,3])
ktu.validate_input_types(inp, orig_inp) # Notice inp is an array
Add a possible fix
Please authorize to post fix