在 docker 中安装 sam

2023-12-15 17:27:16

1、进入 docker,共享一个主机的目录。

docker run -it --gpus all -v /home/wjp/host_share:/host_share 0783

2、在主机的目录中做 git clone。

git clone https://github.com/facebookresearch/segment-anything.git

3、进入 segment-anything 目录,用 pip install . 安装。

Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Processing /host_share/segment-anything
Building wheels for collected packages: segment-anything
  Building wheel for segment-anything (setup.py) ... done
  Created wheel for segment-anything: filename=segment_anything-1.0-py3-none-any.whl size=36611 sha256=d6a271afdc6950d5cc982624b35546b53fcaa6108ee1038f79bac47f247c171a
  Stored in directory: /tmp/pip-ephem-wheel-cache-jk17gyup/wheels/60/b1/ff/9fd50a5f9f5b78f33e1efd50ddc085119d0d92ff66dded09fc
Successfully built segment-anything
Installing collected packages: segment-anything
Successfully installed segment-anything-1.0

注意:如果用 pip install -e . 安装,提示信息是这样的

Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Obtaining file:///host_share/segment-anything
Installing collected packages: segment-anything
  Running setup.py develop for segment-anything
Successfully installed segment-anything

其实没装上。

文章来源:https://blog.csdn.net/blueblood7/article/details/135017133
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。