resnetv2 测试
【摘要】
depth 44
1*3*512*512 1070 12ms
tx2上56跑不起来,44的 跑不动
https://github.com/X-czh/accelerating-resnet/blob/328b5bb5cc896c8ecee9ebf373e6e3aa71dc5bde/resnetv2.py
impo...
depth 44
1*3*512*512 1070 12ms
tx2上56跑不起来,44的 跑不动
-
-
import os
-
import math
-
import time
-
-
import torch
-
import torch.nn as nn
-
import torch.nn.functional as F
-
from torch.autograd import Variable
-
-
-
cfg = [20, 32, 44, 56, 110, 164, 1001]
-
-
def conv3x3(in_channels, out_channels, stride=1):
-
return nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=stride,
-
padding=1, bias=False)
-
-
class PreActBlock(nn.Module):
-
expansion = 1
-
-
def __init__(self, in_channels, out_channels, stride=1):
-
super(PreActBlock, self).__init__()
-
-
self.bn1 = nn.BatchNorm2d(in_channels)
-
self.conv1 = conv3x
文章来源: blog.csdn.net,作者:网奇,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/jacke121/article/details/92673156
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)