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ビュー
回答なし

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ