
python
刘阿宾
不想当一体机的程序员不是好车车人
展开
-
【一行代码系列】Python 的多线程
一行代码 Python 多线程原创 2022-04-07 14:00:38 · 608 阅读 · 0 评论 -
个人 Windows 环境 pytorch+cuda 配置记录(2021.9)
最近重装了下工位电脑,需要重新配置编程环境查看显卡对应的 CUDA版本在桌面上右击 “NVIDIA 控制面板”在 “组件” 标签查看 driver 版本下载对应 CUDA 版本下载链接:https://developer.nvidia.com/cuda-toolkit-archive安装在 cmd 中输入测试代码nvcc -V版本信息nvcc: NVIDIA (R) Cuda compiler driverCopyright (c) 2005-2021 NVIDIA .原创 2021-09-13 16:51:19 · 276 阅读 · 0 评论 -
pytorch单机多 GPU 运行
torch.nn.parallel.DistributedDataParallelfrom torch.nn.parallel import DistributedDataParalleltorch.distributed.init_process_group(backend="nccl")model = model.cuda()model = DistributedDataParallel(model)运行命令行python3 -m torch.distributed.launch ma原创 2021-05-05 14:06:06 · 210 阅读 · 0 评论 -
python split 多种标点 分割
python 自带的 split() 只能根据单一字符串分割需要使用正则库 reimport rere.split("[,|.|?|!]", <string>)原创 2020-12-12 21:35:29 · 4367 阅读 · 0 评论