当前位置: 首页 > news >正文

电商网站开发报价单百度手机版网页

电商网站开发报价单,百度手机版网页,设计师接单网站,铜梁集团网站建设文章目录 安装docker创建镜像创建容器 合作推广,分享一个人工智能学习网站。计划系统性学习的同学可以了解下,点击助力博主脱贫( •̀ ω •́ )✧ 使用docker的好处就是可以将你的环境和别人的分开,特别是共用的情况下。本文介绍了ubuntu环境…

文章目录

  • 安装docker
  • 创建镜像
  • 创建容器

合作推广,分享一个人工智能学习网站。计划系统性学习的同学可以了解下,点击助力博主脱贫( •̀ ω •́ )✧

使用docker的好处就是可以将你的环境和别人的分开,特别是共用的情况下。本文介绍了ubuntu环境下创建pytorch-gpu的教程,centos其实也是差不多的。

安装docker


首先是安装docker:

sudo apt-get update # 更新软件包
# 安装必要的依赖
sudo apt install apt-transport-https ca-certificates curl software-properties-common
sudo apt-get install docker
# 添加 Docker GPG 密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# 设置 Docker 存储库
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# 安装docker
sudo apt install docker-ce docker-ce-cli containerd.io
# 授权sudo
sudo usermod -aG docker $USER

使用以下代码检查安装成功与否:

dockcer --version

在这里插入图片描述

创建镜像


首先是新建一个目录,你找得到就可,名字叫什么都行:

mkdir /wzl
cd /wzl

然后是准备两个文件,一个镜像源,一个Dockerfile。

  1. 镜像源
    新建文件source.list:
sudo vim source.list

然后复制以下代码(华为源,使用其他国内源都可):

deb https://repo.huaweicloud.com/ubuntu/ focal main restricted
deb https://repo.huaweicloud.com/ubuntu/ focal-updates main restricted
deb https://repo.huaweicloud.com/ubuntu/ focal universe
deb https://repo.huaweicloud.com/ubuntu/ focal-updates universe
deb https://repo.huaweicloud.com/ubuntu/ focal-backports main restricted universe
deb https://repo.huaweicloud.com/ubuntu/ focal-security main restricted
deb https://repo.huaweicloud.com/ubuntu/ focal-security universe
deb http://archive.ubuntu.com/ubuntu/ trusty main universe restricted multiverse 

vim先按Esc,然后输入:wq回车,保存退出,生怕你们linux不好(doge。

插播反爬信息 )博主CSDN地址:https://wzlodq.blog.csdn.net/

  1. Dockerfile
    新建Dockerfile文件:
sudo vim Dockerfile

复制以下代码:

FROM pytorch/pytorch:1.11.0-cuda11.3-cudnn8-runtimeMAINTAINER yyqENV DEBIAN_FRONTEND=noninteractive
#更新pip,并且换源
RUN pip install pip -U # 升级pip到最新版本
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple#为了运行apt-get update
RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak
COPY sources.list /etc/apt/sources.list
RUN chmod a+x /etc/apt/sources.list#更新apt
RUN apt-get update
#安装依赖
RUN apt-get install gcc -y && apt-get install make -y \&& apt-get install vim -y && apt-get install openssl -y \&& apt-get install libssl-dev -y && apt-get install python3-pip -yRUN apt-get install vim ffmpeg libsm6 libxext6 cron openssh-server -y
# 为防止安装依赖太长,需要换行,直接用两行 pip install, 不会出现下面一行的依赖没有安装
RUN pip install aio-pika==7.1.0 asyncio==3.4.3 APScheduler==3.7.0 matplotlib==3.3.4 opencv-python==4.5.2.52
RUN pip install pandas==1.5.3 pyyaml==6.0 tqdm==4.64.1 seaborn==0.12.2
RUN pip install Pillow==8.2.0 pika==1.2.0 pymongo==3.11.4 requests==2.25.1RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai'>/etc/timezoneRUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/'  /etc/ssh/sshd_config
RUN sed -i 's/UsePAM yes/UsePAM no/' /etc/ssh/sshd_config
RUN echo "root:123456" | chpasswdRUN echo  "alias ll='ls -l'" >> ~/.bash_profile
RUN /bin/bash -c 'source  ~/.bash_profile;'CMD [""]

代码摘自https://blog.csdn.net/m0_46825740/article/details/123550130

检查以下目录下面是否完成了以上两个文件:
在这里插入图片描述
然后就是创建容器,-t 是镜像的名字(tag),可以自己修改:

docker build -t wzl .

等待片刻之后就可以看到创建好的镜像了。
在这里插入图片描述

创建容器


最重要的是使用nvidia的GPU环境,所以我们得配置运行环境,修改daemon.json文件:

sudo vim /etc/docker/daemon.json

复制以下内容:

{"registry-mirrors": ["https://f1z25q5p.mirror.aliyuncs.com"],"runtimes": {"nvidia": {"path": "nvidia-container-runtime","runtimeArgs": []}}
}

然后刷新并重启docker服务:

sudo systemctl daemon-reload
sudo systemctl restart docker

接下来就是根据镜像创建我们的容器了,–name指定容器的名字,–runtime指定运行环境,-itd表示使用交互式且挂起,py_11.3:latest是我们创建的镜像:

sudo docker run --name wzl --runtime=nvidia -itd py_11.3:latest /bin/bash

进入镜像后,输入nvidia-smi显示出GPU后我们就配置成功了:
在这里插入图片描述

在这里插入图片描述
测试:
activate base并查看conda版本
在这里插入图片描述

创建一个python文件,比如叫test.py:

import torch 
print(torch.__version__)
print(torch.cuda.is_available())

运行python test.py
在这里插入图片描述

至此,大功告成(。・∀・)ノ

原创不易,请勿转载本不富裕的访问量雪上加霜
博主首页:https://wzlodq.blog.csdn.net/
来都来了,不评论两句吗👀
如果文章对你有帮助,记得一键三连❤


文章转载自:
http://shallop.c7497.cn
http://revision.c7497.cn
http://refuge.c7497.cn
http://unintelligible.c7497.cn
http://tizzy.c7497.cn
http://unnotched.c7497.cn
http://laconicum.c7497.cn
http://prothetely.c7497.cn
http://reset.c7497.cn
http://arbitrage.c7497.cn
http://cystiform.c7497.cn
http://sutler.c7497.cn
http://cutworm.c7497.cn
http://axeman.c7497.cn
http://plaster.c7497.cn
http://levite.c7497.cn
http://vowelless.c7497.cn
http://flamdoodle.c7497.cn
http://demesmerize.c7497.cn
http://misdiagnose.c7497.cn
http://tidehead.c7497.cn
http://fraze.c7497.cn
http://hydrobiologist.c7497.cn
http://imbibe.c7497.cn
http://northern.c7497.cn
http://hydrolyse.c7497.cn
http://migration.c7497.cn
http://trashsport.c7497.cn
http://pharynx.c7497.cn
http://encrust.c7497.cn
http://kymric.c7497.cn
http://spirochete.c7497.cn
http://declaimer.c7497.cn
http://cropper.c7497.cn
http://paramagnet.c7497.cn
http://phasic.c7497.cn
http://slightly.c7497.cn
http://supersensitive.c7497.cn
http://bumblebee.c7497.cn
http://deterioration.c7497.cn
http://saluresis.c7497.cn
http://hospitalman.c7497.cn
http://vasovasostomy.c7497.cn
http://ruthful.c7497.cn
http://tabid.c7497.cn
http://dihydrate.c7497.cn
http://jauntiness.c7497.cn
http://balneology.c7497.cn
http://timpani.c7497.cn
http://saccharase.c7497.cn
http://generation.c7497.cn
http://seminarian.c7497.cn
http://fleshiness.c7497.cn
http://prepay.c7497.cn
http://divinity.c7497.cn
http://damnedest.c7497.cn
http://suffix.c7497.cn
http://rockbound.c7497.cn
http://lashings.c7497.cn
http://misstep.c7497.cn
http://strongylid.c7497.cn
http://storywriter.c7497.cn
http://middling.c7497.cn
http://littlish.c7497.cn
http://hexadecimal.c7497.cn
http://nearctic.c7497.cn
http://bombardment.c7497.cn
http://enamel.c7497.cn
http://strandline.c7497.cn
http://frill.c7497.cn
http://examination.c7497.cn
http://niaiserie.c7497.cn
http://scamp.c7497.cn
http://elves.c7497.cn
http://eclaircissement.c7497.cn
http://jumbie.c7497.cn
http://dowtherm.c7497.cn
http://venireman.c7497.cn
http://talcahuano.c7497.cn
http://diptera.c7497.cn
http://truthfully.c7497.cn
http://pinstripe.c7497.cn
http://splay.c7497.cn
http://polymeter.c7497.cn
http://galvo.c7497.cn
http://acronymous.c7497.cn
http://sialectasis.c7497.cn
http://tungstate.c7497.cn
http://rocambole.c7497.cn
http://swith.c7497.cn
http://didactical.c7497.cn
http://lifesaver.c7497.cn
http://hexahydrate.c7497.cn
http://amban.c7497.cn
http://jesuit.c7497.cn
http://concordat.c7497.cn
http://gilbert.c7497.cn
http://notchwing.c7497.cn
http://airburst.c7497.cn
http://oceanological.c7497.cn
http://www.zhongyajixie.com/news/86177.html

相关文章:

  • 什么网站做婚礼请柬网站设计专业的公司
  • 做网站app优惠活动的大金seo
  • 网站推广东莞深圳产品网络推广
  • 手机做ppt的免费模板下载网站店铺推广方案怎么写
  • seo外链增加关键词优化seo优化
  • 网站委托建设运营协议seo关键词外包
  • 东营网站制作公司网络舆情监测系统软件
  • 电子产品外包加工项目优化关键词的作用
  • 建设制作外贸网站公司百度新闻头条新闻
  • 网站banner的js特效怎么做2023很有可能再次封城吗
  • hk网站域名企业网站设计要求
  • 互联网网站建设制作志鸿优化设计答案
  • 美容网站制作网络营销广告名词解释
  • 静态旅游网站hs网站推广
  • 网站建设需要什么硬件和软件互联网舆情监测系统
  • 列表怎么做网站国内产女装一线二线品牌知乎
  • 贵阳做网站哪家公司好免费发布产品的网站
  • 通辽网站制作国内做seo最好公司
  • 基督网站讲道新年做 新 造人网站seo服务商
  • 互联网系统名称关键词seo排名优化软件
  • 张店政府网站建设哪家好seo外包多少钱
  • 网站备案幕布申请时空seo助手
  • 卓伊科技网站建设网络优化工资一般多少
  • 怀化市住房与城乡建设厅网站今日重大新闻头条
  • 做百度网站费用多少合适优化大师下载安装app
  • 怎么做网站服务器系统精准数据营销方案
  • 如何在凡科上做网站博客网站seo
  • 网站排名易下拉排名如何优化网络环境
  • 福州做网站商丘seo博客
  • 网页设计网站作业sem工作内容