Sagemaker reporting SSLError while trying to predict

0

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.

已提問 1 年前檢視次數 97 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南