我想设置stable-diffusion在我的机器(M1 MacOS)上,基于 these instructions ,我正在运行:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh
bash Miniconda3-latest-MacOSX-arm64.sh
我接受许可证并确认安装位置,一切看起来都很好。
然后,当我想使用 conda env create -fenvironment.yaml
创建环境时,遇到以下错误:
ResolvePackageNotFound:
- python=3.8.5
- cudatoolkit=11.3
- pip=20.3
- torchvision=0.12.0
environment.yaml 文件包含以下内容:
name: ldm
channels:
- pytorch
- defaults
dependencies:
- python=3.8.5
- pip=20.3
- cudatoolkit=11.3
- pytorch=1.11.0
- torchvision=0.12.0
- numpy=1.19.2
- pip:
- albumentations==0.4.3
- diffusers
- opencv-python==4.1.2.30
- pudb==2019.2
- invisible-watermark
- imageio==2.9.0
- imageio-ffmpeg==0.4.2
- pytorch-lightning==1.4.2
- omegaconf==2.1.1
- test-tube>=0.7.5
- streamlit>=0.73.1
- einops==0.3.0
- torch-fidelity==0.3.0
- transformers==4.19.2
- torchmetrics==0.6.0
- kornia==0.6
- -e git+https://github.com/CompVis/taming-transformers.git@master#egg=taming-transformers
- -e git+https://github.com/openai/CLIP.git@main#egg=clip
- -e .
从这里去哪里?我的印象是 conda 会安装所需的依赖项,但我想不会?
最佳答案
核心问题是尝试创建一个 native osx-arm64 环境。
首先,使用 conda-forge
channel 而不是 defaults
。1 其次,原生 PyTorch 包仅适用于 pytorch >=1.12
和 torchvision >=0.13
。第三,Apple Silicon 系统不附带 nVidia 卡,因此 cudatoolkit
不合适 - 将其删除。
可能还有更多问题,但这只是一个开始。另外,你可能应该 read this thread密切关注。
[1]:您最好安装 a Miniforge variant就像 Mambaforge,而不是 Miniconda。 Conda Forge 已经支持 osx-arm64 近两年了,因此比 defaults
channel 拥有更深入的可用软件包目录,后者在 5 月份才添加了支持。
关于python - 在 MacOS 上创建 conda 环境失败 : ResolvePackageNotFound,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73528496/