I created a custom model from MultiOutputRegressor of sklearn.
The train worked but I have the error AttributeError: module 'main' has no attribute 'DataTransformer' when publishing an end point of the model.
script.py is my script to train model
DataTransformer.py is the file where I declare a custom class from the MultiOutputRegressor of sklearn.
estimator = SKLearn(
entry_point="script.py",
role=role_name,
train_instance_count=1, # training instance count
train_instance_type=instance_type, # training instance type
output_path=f's3://{bucket}/{prefix}/output', # S3 location for output data
sagemaker_session=sess,
framework_version='0.23-1',
base_job_name=base_job_name,
hyperparameters={'data_path': dataset_to_train},
dependencies=['DataTransformer.py'],
source_dir='s3://mybucket/pyscripts/source.tar.gz')
The files script.py and DataTransformer.py is zipped and uploaded on S3, the 'source_dir' points to the .tar.gz file.
How would I modify my script to make it work?
Hi,
I created a custom model from MultiOutputRegressor of sklearn. The train worked but I have the error AttributeError: module 'main' has no attribute 'DataTransformer' when publishing an end point of the model.
I found a topic with the same issue here and tried the proposition but it's still not working. [https://github.com/aws/amazon-sagemaker-examples/issues/725]
Here's my settings:
estimator = SKLearn( entry_point="script.py", role=role_name, train_instance_count=1, # training instance count train_instance_type=instance_type, # training instance type output_path=f's3://{bucket}/{prefix}/output', # S3 location for output data sagemaker_session=sess, framework_version='0.23-1', base_job_name=base_job_name, hyperparameters={'data_path': dataset_to_train}, dependencies=['DataTransformer.py'], source_dir='s3://mybucket/pyscripts/source.tar.gz')
The files script.py and DataTransformer.py is zipped and uploaded on S3, the 'source_dir' points to the .tar.gz file. How would I modify my script to make it work?