1 Star 0 Fork 0

liuzhaopk/buzz-based-anomaly

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build_docker.sh 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
echo "-> Running build docker image script..."
HOST_CUDA_VERSION=$(nvcc --version | sed -n 's/^.*release \([0-9\.]\+\).*$/\1/p')
echo "-> Running on host with cuda:$HOST_CUDA_VERSION"
PYTORCH_CUDA_VERSION=$HOST_CUDA_VERSION
DOCKER_CUDA_VERSION=$DOCKER_CUDA_VERSION
while getopts ":d:p:" opt; do
case $opt in
d) DOCKER_CUDA_VERSION="$OPTARG"
echo "-> using nvidia/cuda docker image with version $OPTARG"
;;
p) PYTORCH_CUDA_VERSION="$OPTARG"
echo "-> using pytorch with cuda toolkit with version $OPTARG"
;;
\?) echo "Invalid option -$OPTARG" >&2
;;
esac
done
if [ "$PYTORCH_CUDA_VERSION" != "$DOCKER_CUDA_VERSION" ]
then
echo "-> ! WARNING ! possible mismatch for local cuda version, docker image and pytorch cuda toolkit installer!"
echo " pytorch_v($PYTORCH_CUDA_VERSION) / docker_cuda_v($DOCKER_CUDA_VERSION)"
fi
cp environment.yml environment_backup.yml
awk -v cuda_ver="$PYTORCH_CUDA_VERSION" '{sub(/\${CUDA_TOOLKIT_VERSION}/, cuda_ver)}1' environment_backup.yml > environment.yml
docker build -t "buzz-based-anomaly:cuda-$DOCKER_CUDA_VERSION" . --build-arg CUDA_VERSION="$DOCKER_CUDA_VERSION"
mv environment_backup.yml environment.yml
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liuzhaopk/buzz-based-anomaly.git
git@gitee.com:liuzhaopk/buzz-based-anomaly.git
liuzhaopk
buzz-based-anomaly
buzz-based-anomaly
master

搜索帮助