
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
容器镜像运行容器构建容器
sam容器默认运行命令会启动Jupyter Lab,笔记本目录为/opt/
使用Web浏览器访问 http://主机名:8888
进入Jupyter Lab后,导航至notebooks目录。
打开automatic_mask_generator_example.ipynb。
在第4个单元格下方创建新单元格,输入以下内容并执行:
!wget https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth
然后开始执行设置部分下方的单元格。
打开predictor_example.ipynb。
确保notebooks目录下已保存sam_vit_h_4b8939.pth检查点文件。
然后开始执行设置部分下方的单元格。
可运行以下命令执行基准测试脚本:
python3 benchmark.py --save sam.csv
完整选项示例:
python3 benchmark.py \ --images https://raw.githubusercontent.com/facebookresearch/segment-anything/main/notebooks/images/dog.jpg https://raw.githubusercontent.com/facebookresearch/segment-anything/main/notebooks/images/groceries.jpg \ --runs=1 --warmup=0 \ --save sam.csv
输出文件:
sam_benchmark_output.jpg:基准测试输出图像sam.csv(可选):基准测试数据CSV文件sam | 详情 |
|---|---|
| 构建状态 | |
| 系统要求 | L4T ['>=34.1.0'] |
| 依赖项 | https://github.com/dusty-nv/jetson-containers/tree/master/packages/build/build-essential https://github.com/dusty-nv/jetson-containers/tree/master/packages/cuda/cuda https://github.com/dusty-nv/jetson-containers/tree/master/packages/cuda/cudnn https://github.com/dusty-nv/jetson-containers/tree/master/packages/build/python https://github.com/dusty-nv/jetson-containers/tree/master/packages/numpy https://github.com/dusty-nv/jetson-containers/tree/master/packages/build/cmake/cmake_pip https://github.com/dusty-nv/jetson-containers/tree/master/packages/onnx https://github.com/dusty-nv/jetson-containers/tree/master/packages/pytorch https://github.com/dusty-nv/jetson-containers/tree/master/packages/pytorch/torchvision https://github.com/dusty-nv/jetson-containers/tree/master/packages/tensorrt https://github.com/dusty-nv/jetson-containers/tree/master/packages/onnxruntime https://github.com/dusty-nv/jetson-containers/tree/master/packages/opencv https://github.com/dusty-nv/jetson-containers/tree/master/packages/build/rust https://github.com/dusty-nv/jetson-containers/tree/master/packages/jupyterlab |
| 被依赖项 | https://github.com/dusty-nv/jetson-containers/tree/master/packages/vit/efficientvit https://github.com/dusty-nv/jetson-containers/tree/master/packages/vit/tam |
| Dockerfile | https://github.com/dusty-nv/jetson-containers/tree/master/packages/vit/sam/Dockerfile |
| 镜像列表 | https://hub.docker.com/r/dustynv/sam/tags (2023-11-05, 6.1GB)https://hub.docker.com/r/dustynv/sam/tags (2024-03-07, 6.1GB)https://hub.docker.com/r/dustynv/sam/tags (2024-01-13, 6.1GB)https://hub.docker.com/r/dustynv/sam/tags (2024-03-07, 7.9GB) |
| 仓库/标签 | 日期 | 架构 | 大小 |
|---|---|---|---|
| https://hub.docker.com/r/dustynv/sam/tags | 2023-11-05 | arm64 | 6.1GB |
| https://hub.docker.com/r/dustynv/sam/tags | 2024-03-07 | arm64 | 6.1GB |
| https://hub.docker.com/r/dustynv/sam/tags | 2024-01-13 | arm64 | 6.1GB |
| https://hub.docker.com/r/dustynv/sam/tags | 2024-03-07 | arm64 | 7.9GB |
容器镜像与其他JetPack/L4T次要版本兼容:
• L4T R32.7容器可在其他L4T R32.7版本上运行(JetPack 4.6+)
• L4T R35.x容器可在其他L4T R35.x版本上运行(JetPack 5.1+)
要启动容器,可使用 https://github.com/dusty-nv/jetson-containers/tree/master/docs/run.md 和 https://github.com/dusty-nv/jetson-containers/tree/master/docs/run.md#autotag%EF%BC%8C%E6%88%96%E6%89%8B%E5%8A%A8%E7%BB%84%E5%90%88 docker run 命令:
bash# 自动拉取或构建兼容的容器镜像 jetson-containers run $(autotag sam) # 或显式指定上述容器镜像之一 jetson-containers run dustynv/sam:r36.2.0 # 或使用 'docker run'(指定镜像和挂载等) sudo docker run --runtime nvidia -it --rm --network=host dustynv/sam:r36.2.0
https://github.com/dusty-nv/jetson-containers/tree/master/docs/run.md 将参数转发给
docker run,并添加一些默认值(如--runtime nvidia、挂载/data缓存、检测设备)
https://github.com/dusty-nv/jetson-containers/tree/master/docs/run.md#autotag 查找与JetPack/L4T版本兼容的容器镜像 - 本地镜像、从仓库拉取或构建新镜像。
要将本地目录挂载到容器中,使用 -v 或 --volume 标志:
bashjetson-containers run -v /主机路径:/容器路径 $(autotag sam)
要启动容器运行命令而非交互式shell:
bashjetson-containers run $(autotag sam) my_app --abc xyz
可传递任何 docker run 支持的选项,执行前会打印完整命令。
如果如上所示使用 https://github.com/dusty-nv/jetson-containers/tree/master/docs/run.md#autotag%EF%BC%8C%E9%9C%80%E8%A6%81%E6%97%B6%E4%BC%9A%E6%8F%90%E7%A4%BA%E6%9E%84%E5%BB%BA%E5%AE%B9%E5%99%A8%E3%80%82%E8%A6%81%E6%89%8B%E5%8A%A8%E6%9E%84%E5%BB%BA%EF%BC%8C%E9%A6%96%E5%85%88%E5%AE%8C%E6%88%90 https://github.com/dusty-nv/jetson-containers/tree/master/docs/setup.md%EF%BC%8C%E7%84%B6%E5%90%8E%E8%BF%90%E8%A1%8C%EF%BC%9A
bashjetson-containers build sam
上述依赖项将构建到容器中,并在构建过程中进行测试。使用 https://github.com/dusty-nv/jetson-containers/tree/master/jetson_containers/build.py 获取构建选项。
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。





来自真实用户的反馈,见证轩辕镜像的优质服务