aws / amazon-sagemaker-examples

Example 📓 Jupyter notebooks that demonstrate how to build, train, and deploy machine learning models using 🧠 Amazon SageMaker.
https://sagemaker-examples.readthedocs.io
Apache License 2.0
10.16k stars 6.78k forks source link

Open svs file in s3 #1059

Open vankhoa21991 opened 4 years ago

vankhoa21991 commented 4 years ago

Hello, I'm trying to open an svs file in s3 using sagemaker notebook and it doesn't work, my code is like

import openslide

bucket='' data_key = 'abc.svs' data_location = 's3://{}/{}'.format(bucket, data_key) openslide.OpenSlide(data_location)

and I received the answer: OpenSlideUnsupportedFormatError: Unsupported or missing image file

blink1073 commented 4 years ago

Hi @vankhoa21991, it looks like openslide doesn't support reading s3 files directly. You can download the file using boto and read from the local file.

vankhoa21991 commented 4 years ago

Thanks for your answer, how doies it cost when we copy files from s3 to sagemaker, and the latency is also a concern when svs images take more than one GB each image on average.

jaipreet-s commented 4 years ago

Hi @vankhoa21991 You can refer to Amazon SageMaker and Amazon S3 pricing at https://aws.amazon.com/sagemaker/pricing/ and https://aws.amazon.com/s3/pricing/ respectively.