赞
踩
1.新建docker环境
- docker run -tid --name e_commerce_sd --net host --runtime=nvidia nvidia/cuda:11.1-cudnn8-devel-cent os7-ssh /bin/bash
-
- docker exec -ti e_commerce_sd /bin/bash
- echo 'export PS1="DOCKER[\u@\h \w]\$"' > ~/.bashrc
- exit
- docker exec -ti e_commerce_sd /bin/bash
- exit
- docker cp e_commerce_sd.zip e_commerce_sd:/root
- docker exec -ti e_commerce_sd /bin/bash
-
- docker commit e_commerce_sd e_commerce_sd_sam:v1.0
-
- docker run -tid --name img2img_revanimated_v121inp_run --restart=always --cpus=10 --net host --runtime=nvidia img2img_revanimated_v121inp:v1.0.0 /bin/bash
-
- docker save -o e_commerce_sd_all_v101.tar e_commerce_sd_all:v1.0.1
- scp -r root@10.244.6.233:/root/e_commerce_sd_all_v101.tar root@10.111.132.199:/home
- docker load < e_commerce_sd_all_v101.tar
-
- 更新容器中时间:
- date
- TimeZone=Asia/Shanghai
- ln -snf /usr/share/zoneinfo/$TimeZone /etc/localtime && echo $TimeZone > /etc/timezone
-
- 删除镜像
- docker images
- docker rmi IMAGE ID
- 删除容器
- docker rm -f CONTAINER ID
2.安装miniconda
- yum install wget
- wget -c https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
- sh Miniconda3-latest-Linux-x86_64.sh
- source ~/.bashrc
-
- conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- conda config --set show_channel_urls yes
- python -m pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
- python -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
-
- conda create -n py38 python==3.8
- conda activate py38
3.配置stable_diffusion_webui
直接使用stable_difffusion_webui下的launch.py可能会有些问题,建议
- pip install open_clip-bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b.zip
- pip install CLIP-d50d76daa670286dd6cacf3bcd80b5e4823fc8e1.zip
- pip install GFPGAN-8d2447a2d918f8eba5a4a01463fd48e45126a379.zip
- pip install -r requirements_versions.txt
- pip install opencv-python-headless
- pip install gdown
- pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113
4.安装tensorrt
tar -xzvf TensorRT-8.6.1.6.Linux.x86_64-gnu.cuda-11.8.tar.gz
1.利用vim进入~/.bashrc文档,摁住ctrl+g,直接跳到最后一行,摁一下i键,进入插入模式,现在可以编辑文档了。 2.跳到最后一个字符,摁一下换行,可以在下一行输入命令。 3.一般来说在Ubuntu的终端中,ctrl+shift+c是复制,Ctrl+shift+v是粘贴,可以先写好直接粘贴; 4.我们输入第一个环境变量配置:
- export LD_LIBRARY_PATH=/home/TensorRT-8.6.1.6/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
- export PATH=/home/TensorRT-8.6.1.6/bin${PATH:+:${PATH}}
5.路径添加好了,该关闭~/.bashrc了,摁一下esc键,退出插入模式; 6.输入冒号:wq,关闭bashrc; 7.这时候还没有生效!需要source一下
source ~/.bashrc
- cd python
- pip install tensorrt-8.6.1-cp38-none-linux_x86_64.whl
安装pycuda
pip install pycuda==2019.1
export CUDA_VISIBLE_DEVICES=3
onnxruntime只能调用cpu
conda install cudnn
pip install onnxruntime==1.15.1即可,重新装一下就行了
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。