amazon-web-servicesamazon-s3amazon-ec2amazon-sagemaker

Unable to upload data using sagemaker_session.upload_data in s3 bucket that I created, it is getting stored in default s3 bucket


So I am trying iris to get acquainted with was sagemaker I am following simple tutorials from link. I have created a bucket named "tf-practise-iris-data" and gave the IAM role of Sagemaker access to the s3 bucket as mentioned in the tutorial. I also tried creating a new bucket with a different name thinking there might be some problem with a bucket but still it is having the same issue, this is the snippet of my code enter image description here. And I have turned off Block all public access from the bucket but still nothing.


Solution

  • Solved it!!!!!!!!!!!!

    prefix = "checking-with-new-bucket"
    training_input_path = sagemaker_session.upload_data('train.csv', bucket = 'checking-with-new-bucket',key_prefix = prefix + "/training")
    training_input_path
    

    Which gave output as

    's3://checking-with-new-bucket/checking-with-new-bucket/training/train.csv'