# n, c, h, w
# ceil((in - kernel_size + 1 + (padding * 2)) / stride) = out
# in: [1, 1, 28, 28]
# ----
# (28 - 3 + 1) / 1 = 26
# out: [1, 16, 26, 26]
Conv2d(1, 16, kernel_size=3, stride=1, padding=0)(inputs)
# in: [1, 1, 28, 28]
# ----
# (28 - 3 + 1) / 2 = 13
# out: [1, 16, 13, 13]
Conv2d(1, 16, kernel_size=3, stride=2, padding=0)(inputs)
# in: [1, 1, 28, 28]
# ----
# (28 - 3 + 1 + (1 * 2)) / 2 = 14
# out: [1, 16, 14, 14]
Conv2d(1, 16, kernel_size=3, stride=2, padding=1)(inputs)
# in: [1, 1, 28, 28]
# ----
# (28 - 3 + 1 + (4 * 2)) / 2 = 17
# out: [1, 16, 17, 17]
Conv2d(1, 16, kernel_size=3, stride=2, padding=4)(inputs)
# in: [1, 1, 28, 28]
# ----
# (28 - 5 + 1 + (10 * 2)) / 4 = 11
# out: [1, 16, 11, 11]
Conv2d(1, 16, kernel_size=5, stride=4, padding=10)(inputs)
# in: [1, 1, 28, 28]
# ----
# (28 - 5 + 1 + (10 * 2)) / 3 = 44 / 3 = cile(14.6) = 15
# out: [1, 16, 15, 15]
Conv2d(1, 16, kernel_size=5, stride=3, padding=10)(inputs)
# in: [1, 1, 28, 28]
# ----
# (28 - 3 + 1 + (7 * 2)) / 6 = ceil(40 / 6) = ceil(6.66666) = 7
# out: [1, 16, 7, 7]
Conv2d(1, 16, kernel_size=3, stride=6, padding=7)(inputs)
# in: [1, 16, 26, 26]
# ----
# (26 - 2 + 1 + (0 * 2)) / 2 = floor(25 / 2) = floor(14.5) = 14
# out: [1, 16, 14, 14]
MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)(inputs)
Read IR model Method 1 :::danger Problem: Recognize first image need more time (initalize time) ::: net.setPreferableBackend 參數
Sep 8, 2022讀取格式為 BGR 讀取圖片 參數 用法 cv2.IMREAD_COLOR 正常顏色
Aug 28, 2022源碼放在:Colab 1. 載入需要的 Module import torch import torch.nn as nn import torchvision import matplotlib.pyplot as plt import torch.utils.data as Data from torch.autograd import Variable import os
Aug 9, 20221. 转换形态 torch.tensor([[1, 1, 1], [-1, -1, -1]], dtype=torch.int8) temp = torch.tensor(np.array([[1, 2, 3], [4, 5, 6]])) print(temp[0][0].item()) torch.zeros([1, 3], dtype=torch.int32) cuda = torch.device('cuda:0') torch.ones([2, 2], dtype=torch.float32, device=cuda) temp = torch.tensor([[1, 1, 1], [-1, -1, -1]], dtype=torch.float32, requires_grad=True)
Aug 9, 2022or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up