21 Star 72 Fork 73

openEuler/openeuler-docker-images
关闭

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 1.12 KB
一键复制 编辑 原始数据 按行查看 历史
baigj 提交于 2025-03-24 12:35 +08:00 . update: container image classification
ARG BASE=openeuler/cann:8.0.RC1-oe2203sp4
FROM ${BASE}
# Arguments
ARG VERSION=2.2.0
ARG AUDIO_VERSION=2.2.0
ARG NPU_VERSION=2.2.0
ARG TORCH_VERSION=0.17.0
# Change the default shell
SHELL [ "/bin/bash", "-c" ]
# Install pytorch, torch-npu and related packages
RUN if [ "${VERSION}" == "2.1.0" ]; then \
TORCH_VERSION=0.16.0; \
AUDIO_VERSION=2.1.0; \
NPU_VERSION=2.1.0; \
elif [ "${VERSION}" == "2.2.0" ]; then \
TORCH_VERSION=0.17.0; \
AUDIO_VERSION=2.2.0; \
NPU_VERSION=2.2.0; \
else \
echo "Not supported version: ${VERSION}. Feel free to submit an issue to us: https://github.com/cosdt/dockerfiles/issues"; \
exit 1; \
fi && \
# Uninstall the latest numpy and sympy first, as the right versions will be installed again \
# after installing following packages \
pip uninstall -y numpy sympy && \
pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cpu \
torch==${VERSION} \
torchvision==${TORCH_VERSION} \
torchaudio==${AUDIO_VERSION} && \
pip install --no-cache-dir \
torch-npu==${NPU_VERSION}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openeuler/openeuler-docker-images.git
git@gitee.com:openeuler/openeuler-docker-images.git
openeuler
openeuler-docker-images
openeuler-docker-images
master

搜索帮助