I have my training data uploaded to s3 bucket and I have type-casted the columns with float64 dtype to float32 in my training data. I have defined a linear estimator from sagemaker and fit the training data in this cell.
linear = sagemaker.estimator.Estimator(container,
role,
train_instance_count = 1,
train_instance_type = 'ml.c4.xlarge',
output_path = output_location,
sagemaker_session = sagemaker_session)
linear.set_hyperparameters(feature_dim = 147,
predictor_type = 'regressor',
mini_batch_size = 5,
epochs = 5,
num_models = 32,
loss = 'absolute_loss')
# pass in the training data from S3 to train the linear learner model
linear.fit({'train': s3_train_data})
I am getting an error when I run the cell. The last line of fitting the training data throws the below error :
UnexpectedStatusException: Error for Training job linear-learner-2023-02-01-04-16-46-698: Failed. Reason: ClientError: Unable to execute the algorithm. Provided train label is in 'float32' format, 'float32' label is required. Please provide train dataset with 'float32' labels and try again., exit code: 2
I have the training data in float32 format, what am I missing here?
I have converted all the columns in training dataset having float64 format to float32.
float64_cols = list(X_train.select_dtypes(include='float64'))
X_train[float64_cols] = X_train[float64_cols].astype('float32')