English 中文(简体)
如何使用最佳估算器的问题,由age子制造。
原标题:Problem deploying the best estimator gotten with sagemaker.estimator.Estimator (w/ sklearn custom image)

在创建SKLearn(SK)和采用几个高分参数的超配对器后,我获得最好的估算。 当我试图部署(a)估算器时,该估算仪在记录上出现错误。 当我创建变革者和要求转变时,实际上会出现同样的错误。 否进行部署和改变。 问题是什么,至少我如何能够缩小问题?

我根本不知道如何开始说明这一点。 Googling don t help. 无。

创建SK学习学院:

sklearn = SKLearn(
    entry_point=script_path,
    train_instance_type="ml.c4.xlarge",
    role=role,
    sagemaker_session=session,
    hyperparameters={ model :  rfc })

指导工作:

tuner = HyperparameterTuner(estimator = sklearn,
                            objective_metric_name = objective_metric_name,
                            objective_type =  Minimize ,
                            metric_definitions = metric_definitions,
                            hyperparameter_ranges = hyperparameters,
                            max_jobs = 3, # 9,
                            max_parallel_jobs = 4)

tuner.fit({ train : s3_input_train})
tuner.wait()
best_training_job = tuner.best_training_job()
the_best_estimator = sagemaker.estimator.Estimator.attach(best_training_job)

这样就有了有效的最佳培训工作。 一切似乎都是巨大的。

问题表现在这里:

predictor = the_best_estimator.deploy(initial_instance_count=1, instance_type="ml.m4.xlarge")

或以下(问题完全相同):

rfc_transformer = the_best_estimator.transformer(1, instance_type="ml.m4.xlarge")
rfc_transformer.transform(test_location)
rfc_transformer.wait()

这里是带有错误信息的标志(它多次重申同样的错误,同时试图部署或改造;这里是标志的开始):

................[2019-09-22 09:17:48 +0000] [17] [INFO] Starting gunicorn 19.9.0

[2019-09-22 09:17:48 +0000] [17] [INFO] Listening at: unix:/tmp/gunicorn.sock (17)

[2019-09-22 09:17:48 +0000] [17] [INFO] Using worker: gevent

[2019-09-22 09:17:48 +0000] [24] [INFO] Booting worker with pid: 24

[2019-09-22 09:17:48 +0000] [25] [INFO] Booting worker with pid: 25

[2019-09-22 09:17:48 +0000] [26] [INFO] Booting worker with pid: 26

[2019-09-22 09:17:48 +0000] [30] [INFO] Booting worker with pid: 30

2019-09-22 09:18:15,061 INFO - sagemaker-containers - No GPUs detected (normal if no gpus installed)

2019-09-22 09:18:15,062 INFO - sagemaker_sklearn_container.serving - Encountered an unexpected error.

[2019-09-22 09:18:15 +0000] [24] [ERROR] Error handling request /ping

Traceback (most recent call last):

  File "/usr/local/lib/python3.5/dist-packages/gunicorn/workers/base_async.py", line 56, in handle self.handle_request(listener_name, req, client, addr)

  File "/usr/local/lib/python3.5/dist-packages/gunicorn/workers/ggevent.py", line 160, in handle_request addr)

  File "/usr/local/lib/python3.5/dist-packages/gunicorn/workers/base_async.py", line 107, in handle_request respiter = self.wsgi(environ, resp.start_response)

  File "/usr/local/lib/python3.5/dist-packages/sagemaker_sklearn_container/serving.py", line 119, in main user_module_transformer = import_module(serving_env.module_name, serving_env.module_dir)

  File "/usr/local/lib/python3.5/dist-packages/sagemaker_sklearn_container/serving.py", line 97, in import_module user_module = importlib.import_module(module_name)

  File "/usr/lib/python3.5/importlib/__init__.py", line 117, in import_module if name.startswith( . ):

AttributeError:  NoneType  object has no attribute  startswith 

169.254.255.130 - - [22/Sep/2019:09:18:15 +0000] "GET /ping HTTP/1.1" 500 141 "-" "Go-http-client/1.1"

2019-09-22 09:18:15,178 INFO - sagemaker-containers - No GPUs detected (normal if no gpus installed)

2019-09-22 09:18:15,179 INFO - sagemaker_sklearn_container.serving - Encountered an unexpected error.

[2019-09-22 09:18:15 +0000] [30] [ERROR] Error handling request /ping

Traceback (most recent call last):

  File "/usr/local/lib/python3.5/dist-packages/gunicorn/workers/base_async.py", line 56, in handle self.handle_request(listener_name, req, client, addr)

  File "/usr/local/lib/python3.5/dist-packages/gunicorn/workers/ggevent.py", line 160, in handle_request addr)

  File "/usr/local/lib/python3.5/dist-packages/gunicorn/workers/base_async.py", line 107, in handle_request respiter = self.wsgi(environ, resp.start_response)

  File "/usr/local/lib/python3.5/dist-packages/sagemaker_sklearn_container/serving.py", line 119, in main user_module_transformer = import_module(serving_env.module_name, serving_env.module_dir)

  File "/usr/local/lib/python3.5/dist-packages/sagemaker_sklearn_container/serving.py", line 97, in import_module user_module = importlib.import_module(module_name)

  File "/usr/lib/python3.5/importlib/__init__.py", line 117, in import_module if name.startswith( . ):
问题回答

双重检查是确定必要的环境变量。 当我打上了环境变量的编号< 编码>SAGEMAKER_DEFAULT_INVOCATIONS_ACCEPT/code>、SAGEMAKER_PROGRAMSAGEMAKER_SUBMIT_DIRECTORY时,我就谈到了这一问题。 检查工作基础模型,以了解需要确定哪些环境变量。





相关问题
Getting error while importing OneHotEncoder in Python

I am getting an error while importing OneHotEncoder in python. I have restarted the kernel and even installed the latest version of sklearn but still get the error. There is not much info available on ...

sklearn transformer for outlier removal - returning xy?

I am trying to remove rows that are labeled outliers. I have this partially working, but not in the context of a pipeline and I am not sure why. from sklearn.datasets import make_classification X1, ...

热门标签