文件在Sagemaker Studio中位于哪里?

huangapple go评论47阅读模式
英文:

Where are files located in Sagemaker Studio?

问题

/home/ec2-user/Sagemaker/

然而,当我在Sagemaker Studio的终端中时,我没有看到这个目录。似乎Sagemaker Studio的目录与其他提问者使用的Sagemaker服务不同。这是我在该目录中运行pwd命令时的命令行显示:

sagemaker-user@studio$ pwd
/home/sagemaker-user/sagepipeline_nonomethod/source_dir
sagemaker-user@studio$ 

然而,当我在我的Jupyter笔记本中运行以下命令时:

os.chdir('/home/sagemaker-user/sagepipeline_nonomethod/source_dir')

我收到一个错误消息,说找不到这个目录。因此,我必须缺少目录的一些前缀...

英文:

I have seen answers to this question and the answer is always that these files are located in

/home/ec2-user/Sagemaker/

however when I'm in Terminal in Sagemaker Studio I don't see this. It seems that Sagemaker Studio has a different directory than whichever Sagemaker service other askers are using. This is what my command line looks like when I do pwd in the directory:

sagemaker-user@studio$ pwd
/home/sagemaker-user/sagepipeline_nonomethod/source_dir
sagemaker-user@studio$ 

When I do

os.chdir('/home/sagemaker-user/sagepipeline_nonomethod/source_dir')

inside my jupyter notebook however I get an error that says there is no such directory. So there must be some prefix to the directory that I am missing...

答案1

得分: 2

简而言之,您应该能够在您的笔记本中访问位于/root/sagepipeline_nonomethod/source_dir目录下的文件。解释如下:


如果您在实用工具和文件下的启动器中打开一个终端,您将进入一个系统终端。这是SageMaker Studio中的计算环境,而不是您的笔记本(内核)所在的容器。

/home/sagemaker-user目录是EFS的挂载点,您的Jupyter文件浏览器指向这里。

sagemaker-user@studio$ df -h
Filesystem         Size  Used Avail Use% Mounted on
overlay             32G  5.3M   32G   1% /
tmpfs               64M     0   64M   0% /dev
tmpfs              1.9G     0  1.9G   0% /sys/fs/cgroup
shm                395M     0  395M   0% /dev/shm
/dev/nvme0n1p1     160G   26G  135G  16% /opt/.sagemakerinternal
127.0.0.1:/200005  8.0E   40M  8.0E   1% /home/sagemaker-user
devtmpfs           1.9G     0  1.9G   0% /dev/tty
tmpfs              1.9G     0  1.9G   0% /proc/acpi
tmpfs              1.9G     0  1.9G   0% /sys/firmware

要访问容器环境的终端,请转到启动器 > 笔记本和计算资源 > 打开映像终端

同样的EFS也挂载在/root上。

root@datascience-1-0-ml-t3-medium-1abf3407f667f989be9d86559395:~# df -h
Filesystem         Size  Used Avail Use% Mounted on
overlay             32G   40K   32G   1% /
tmpfs               64M     0   64M   0% /dev
tmpfs              1.9G     0  1.9G   0% /sys/fs/cgroup
shm                395M     0  395M   0% /dev/shm
127.0.0.1:/200005  8.0E   40M  8.0E   1% /root
/dev/nvme0n1p1     160G   24G  137G  15% /opt/.sagemakerinternal
devtmpfs           1.9G     0  1.9G   0% /dev/tty
tmpfs              1.9G     0  1.9G   0% /proc/acpi
tmpfs              1.9G     0  1.9G   0% /sys/firmware
英文:

In short, you should be able to access the directory at /root/sagepipeline_nonomethod/source_dir within your notebook. Explaination follows:


If you open a terminal in the Launcher under Utilities and files, you will arrive at a system terminal. It's the compute environment living in SageMaker Studio, instead of the container where your notebook (kernel) lives.

The /home/sagemaker-user directory is a mountpoint of an EFS, where your Jupyter file browser points to.

sagemaker-user@studio$ df -h
Filesystem         Size  Used Avail Use% Mounted on
overlay             32G  5.3M   32G   1% /
tmpfs               64M     0   64M   0% /dev
tmpfs              1.9G     0  1.9G   0% /sys/fs/cgroup
shm                395M     0  395M   0% /dev/shm
/dev/nvme0n1p1     160G   26G  135G  16% /opt/.sagemakerinternal
127.0.0.1:/200005  8.0E   40M  8.0E   1% /home/sagemaker-user
devtmpfs           1.9G     0  1.9G   0% /dev/tty
tmpfs              1.9G     0  1.9G   0% /proc/acpi
tmpfs              1.9G     0  1.9G   0% /sys/firmware

To access the terminal of the container environment, go to Launcher > Notebooks and compute resources > Open image terminal

The same EFS is mounted on /root

root@datascience-1-0-ml-t3-medium-1abf3407f667f989be9d86559395:~# df -h
Filesystem         Size  Used Avail Use% Mounted on
overlay             32G   40K   32G   1% /
tmpfs               64M     0   64M   0% /dev
tmpfs              1.9G     0  1.9G   0% /sys/fs/cgroup
shm                395M     0  395M   0% /dev/shm
127.0.0.1:/200005  8.0E   40M  8.0E   1% /root
/dev/nvme0n1p1     160G   24G  137G  15% /opt/.sagemakerinternal
devtmpfs           1.9G     0  1.9G   0% /dev/tty
tmpfs              1.9G     0  1.9G   0% /proc/acpi
tmpfs              1.9G     0  1.9G   0% /sys/firmware

答案2

得分: 1

这是因为SageMaker Studio中的文件和笔记本与执行代码的机器分开存在。

SageMaker Studio本质上只是Jupyter的一个主题,带有一些附加功能。在下面的图表中,您可以看到Studio界面和文件由“JupyterServer App”托管,而执行代码的实例是运行容器的独立机器。

Amazon SageMaker Studio笔记本文档提供了对这个架构的有用概述。请参见下面的图表。

文件在Sagemaker Studio中位于哪里?

不过,您的问题似乎与您正在遇到的问题有关。如果您在笔记本中创建一个单元格并执行!pwd!ls,您应该发现可用的文件与SageMaker Studio侧边栏中的文件匹配。

英文:

This occurs because your files and notebooks in SageMaker Studio exist separately to the machine running the kernel to execute your code.

SageMaker Studio is, in essence, just a theme for Jupyter with a few added features. In the below diagram, you can see that your Studio interface and files are hosted by the "JupyterServer App", while the instances that execute your code are separate machines running containers.

The Amazon SageMaker Studio Notebooks documentation provides a helpful overview of this architecture. See the diagram below.

文件在Sagemaker Studio中位于哪里?

Your question appears to be specific to an issue you're having, however. If you create a cell in your notebook and execute !pwd and !ls, you should find that the files available match those in the SageMaker Studio sidebar.

huangapple
  • 本文由 发表于 2023年6月6日 01:40:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/76408811.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定