Torch
齐天大圣~~
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
2020-10-22
方法一:使用torch.cuda.empty_cache()删除一些不需要的变量代码示例如下:try: output = model(input)except RuntimeError as exception: if "out of memory" in str(exception): print("WARNING: out of memory") if hasattr(torch.cuda, 'empty_cache'): t...转载 2020-10-22 17:07:00 · 538 阅读 · 0 评论 -
Pytorch 1.6 多GPU训练 训练Minist
#!/usr/bin/python3# coding: utf-8import torchfrom torchvision import datasets, transformsimport torchvisionfrom tqdm import tqdmdevice_ids = [1, 3, 5,6]BATCH_SIZE = 64# transform = transforms.Compose([transforms.ToTensor(), transforms.Normalize(m原创 2020-09-30 10:50:37 · 367 阅读 · 0 评论
分享