My team followed a tutorial on how to set K-Means model for prediction: https://sagemaker-examples.readthedocs.io/en/latest/sagemaker-python-sdk/1P_kmeans_highlevel/kmeans_mnist.html
After creating the train data, we tried to predict using the following code:
from sagemaker import KMeans
num_clusters = 2
kmeans = KMeans(role=role,
instance_count=1,
instance_type='ml.c4.xlarge',
output_path=<redacted>
init_method='kmeans++',
k=num_clusters
)
kmeans.fit(kmeans.record_set(train_data_scaled.to_numpy().astype('float32')))
kmeans_predictor = kmeans.deploy(initial_instance_count=1, instance_type='ml.c4.xlarge')
kmeans_predictor.predict(train_data_scaled.to_numpy().astype('float32'))
Using conda_python3 kernel in Jupyter Notebook.
But we're seeing the following error
SSLError: SSL validation failed for https://runtime.sagemaker.us-east-1.amazonaws.com/endpoints/kmeans-<redacted>/invocations EOF occurred in violation of protocol (_ssl.c:2396)
We didn't do anything to customize the sagemaker endpoint, documentation for KMeans predict method does not seem to have any flag available to ignore ssl validation either.