我是AWS的新手,我正在尝试分析kaggle上可用的信用欺诈数据集。我通过查看链接"https://aws.amazon.com/blogs/machine-learning/preprocess-input-data-before-making-predictions-using-amazon-sagemaker-inference-pipelines-and-scikit-learn/“中提到的示例来使用它。我将我的信用卡数据集上传到我的s3存储桶中,并执行了以下操作
import boto3
import botocore
import pandas as pd
import sagemaker
from sagemaker import get_execution_role
role = get_execution_role()
bucket = '<mybucket>'
prefix = 'test'
key = 'creditcard.csv'
data_location = 's3://{}/{}/train/{}'.format(bucket,prefix,key)
output_location = 's3://{}/{}/output'.format(bucket, prefix)
containers = {
<mycontainer>
}
sess = sagemaker.Session()
linear = sagemaker.estimator.Estimator(containers[boto3.Session().region_name],
role,
train_instance_count=1,
train_instance_type='ml.c4.xlarge',
output_path=output_location,
sagemaker_session=sess)
linear.set_hyperparameters(feature_dim=31,
predictor_type='binary_classifier',
mini_batch_size=50)
linear.fit({'train': data_location})当我尝试运行此代码时,弹出一条错误消息,显示“要么训练通道为空,要么小批量大小太高。验证训练数据是否包含非空文件,并且小批量大小小于每个训练主机的记录数”。我的训练数据没有任何空文件。如何处理这个错误?*我从我的PC上传了数据集,并将其存储在名为test的文件夹内的存储桶中*该容器是用于线性学习者的标准容器*我想我无法将s3存储桶中的文件连接到我创建的notebook实例。有没有人能证明
发布于 2019-10-22 18:40:18
请仔细检查传入fit()调用的data_location变量的值,并确保它是您期望的值。您还应使用aws cli (即aws s3 ls $data_location)进行检查。
如果你觉得一切正常,那么你需要帮助我们做进一步的调查。不幸的是,只有当我们有失败的培训工作的详细信息时,这才是可能的。您可以在SageMaker论坛上发起对话:https://forums.aws.amazon.com/forum.jspa?forumID=285
https://stackoverflow.com/questions/58060764
复制相似问题