23

I have a folder with predicted masks on AWS Sagemaker. ( It has 4 folders inside it and lot of files inside those folders. ) I want to download the entire folder to my laptop. This might sound so simple and easy, but I could not find a way to do it. Appreciate any help.

Thanks

Newbie
  • 530
  • 1
  • 10
  • 21

4 Answers4

49

You can do that by opening a terminal on sagemaker. Navigate to the path where your folder is. Run the command to zip it

zip -r -X archive_name.zip folder_to_compress

You will find the zipped folder. You can then select it and download it.

Amy123
  • 902
  • 9
  • 15
  • 8
    You can also run this command from the notebook (instead of opening the terminal) using `!zip -r -X archive_name.zip folder_to_compress` – Guy Mar 01 '19 at 12:33
19

you can run into an issue that "zip command cannot be found" in such case first run:

sudo yum install zip unzip

sebtac
  • 538
  • 5
  • 8
0

There is one more way to do this- create a folder on S3 and copy the Sagemaker folder to S3 folder using-

aws s3 sync <sagemaker_folder_path_without_angular_brackets> <s3_folder_path_without_angular_brackets>

and then copy the S3 folder path and use the same command to copy it to the local machine-

aws s3 sync <s3_folder_path> <local_drive_address>

PS: You must have setup AWS CLI on your local machine!

chinya07
  • 1
  • 2
0

I think the simplest and most straightforward approach is zipping and downloading the folder. Of course it has it's limitations and if that doens't fit the bill you can try using S3 way.

I've tried @sebtac approach but failed to install zip using yum. Though I was able to install it using the commands below:

conda install -y -c conda-forge zip
!zip -r -X folder.zip folder-to-zip
Arthur Alvim
  • 1,044
  • 12
  • 23