Closed harryhancock closed 3 years ago
Use sklearn.model_selection.train_test_split(featureSet, labels, val_ratio=.2)
instead of caer.train_val_split()
. The latter function is deprecated in caer
.
So instead of this syntax (which was used in the course):
x_train, x_val, y_train, y_val = caer.train_val_split(featureSet, labels, val_ratio=.2)
use
x_train, x_val, y_train, y_val = sklearn.model_selection.train_test_split(featureSet, labels, val_ratio=.2)
Hi guys, I had the same error than @harryhancock After I have changed the syntax from: x_train, x_val, y_train, y_val = caer.train_val_split(featureSet, labels, val_ratio=.2)
to x_train, x_val, y_train, y_val = sklearn.model_selection.train_test_split(featureSet, labels, test_size=.2)
It has worked.
Thank you!
That's great to hear @locorez! How about you @harryhancock? Did changing the syntax work for you?
@jasmcaus pls help!
import matplotlib.pyplot as plt from tensorflow.keras.utils import to_categorical from tensorflow.keras.callbacks import LearningRateScheduler from sklearn.model_selection import train_test_split
IMG_SIZE = (80,80) @@ -58,9 +59,10 @@ labels = to_categorical(labels, len(characters))
Creating train and validation data
split_data = caer.train_val_split(featureSet, labels, val_ratio=.2)
this produces error:
InvalidArgumentError Traceback (most recent call last)