C3W4 error in train_val_datasets function

Hello,
I am getting the following error when trying to split the dataset into train and validation datasets using tf.keras.utils.split_dataset(dataset=dataset, left_size=0.9, shuffle=True):
“Failed to convert a NumPy array to a Tensor (Unsupported object type tensorflow.python.framework.ops.EagerTensor)”.
I know, the assignment recommended to use tf.dataset.take and tf.dataset.skip methods. I am curious as to why tf.keras.utils.split_dataset is throwing an error

Here the dataset should be a tf.data.Dataset type (a collection of tensor) check out the TF website. I think the numpy type will throw an error!

hi @Vijay_Chandra

can you share a screenshot of the complete error you have got without sharing any grade cell codes as it is against community guidelines.

as far as I remember the issue if not with the tf.keras.utils but the code where you are suppose to convert the data into tensor. So check if you are using the correct variable or correct call arguments.

Regards
DP