海思nnie跑yolov5
- git clone -b v4.0 https://github.com/ultralytics/yolov5.git/
- 删除 ~~[[-1, 1, Focus, [64, 3]], # 0-P1/2 ~~
- 添加 [[-1, 1, Conv, [64, 3, 2]], # 0-P1/2
class ReLU(nn.Module):
@staticmethod
def forward(x):
return nn.ReLU(x)
-
self.act = nn.SiLU() if act is True else (act if isinstance(act, nn.Module) else nn.Identity()) -
添加 self.act = nn.ReLU() if act is True else (act if isinstance(act, nn.Module) else nn.Identity())
- self.m = nn.ModuleList([nn.MaxPool2d(kernel_size=x, stride=1, padding=x // 2, ceil_mode = True) for x in k])
-
[-1, 1, nn.Upsample, [None, 2, 'nearest']], -
添加 [-1, 1, nn.ConvTranspose2d, [256,256, 2, 2]],
-
[-1, 1, nn.Upsample, [None, 2, 'nearest']], -
添加 [-1, 1, nn.ConvTranspose2d, [128 ,128, 2, 2]],
- torch.onnx.export(model, img, f, verbose=False, opset_version=10, input_names=['images']...
- 将ONNX 转为caffe模型。