- 博客(5)
- 收藏
- 关注
原创 Docker服务器里端口的穿透,一次失败的经历
Docker服务器里端口的穿透,一次失败的经历 问题描述 实验室有一台GPU服务器,由于超过10个人要用,后续师弟师妹来的话用的人更多,所以我就采用了Docker搭建了多人公用的GPU服务器,这样给每个人都分配一个端口即可。因为有的师弟想用Jupyter Notebook(这一点我是不太认可的,个人觉得还是命令行,如vim啦非常好用),他就在他的Docker容器里安装了Jupyter,但是启动的时候要通过浏览器访问,直接通过宿主机是无法访问的,这一点是因为容器被宿主机包括,而访问Jupyter要通过访问宿
2022-05-06 20:52:08
715
原创 单机多卡训练神经网络
单机多卡训练神经网络DDP(DistributedDataParallel)如何迅速集成?笔者遇到的问题解决方案 DDP(DistributedDataParallel) DDP优于DP,这里不做赘述,请读者自己搜索吧。 如何迅速集成? 直接上代码: 第一步:初始化 dist.init_process_group(backend='nccl') local_rank = torch.distributed.get_rank() torch.cuda.set_device(local_rank) device
2021-12-30 22:03:15
954
原创 三天打鱼两天晒网算法
根据“三天打鱼两天晒网”,从1月1日开始算,输入日期确定那天是打鱼还是晒网 #include <iostream> #include <string> #include <sstream> #include <cmath> using namespace std; int main(int argc, char** argv) { bool t...
2020-03-26 19:23:13
851
原创 找一个真分数的埃及分数,c++版
找一个真分数的埃及分数,c++版 埃及分数就是分子是1的分数,找法不唯一,由于浮点数表示不准确,本程序的精度控制在第19行 #include <iostream> #include <string> #include <sstream> #include <cmath> using namespace std; int main(int argc...
2020-03-26 18:52:45
388
原创 用程序验证哥德巴赫猜想
用程序验证哥德巴赫猜想,c++,程序不规范,请多指教`#include #include #include <math.h> using namespace std; void ff(int a[],int n) { int tt=0; bool f=true; for(int i=1;i<=100000;i++) { for(int j=2;j<=sqrt(i);j+...
2020-03-26 17:46:33
1016
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人