mobilenet v4 导出onnx onnx推理
目录
torch推理:
导出onnx:
onnx推理:
torch推理:
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import argparse
import configparser
import shutil
from collections import OrderedDictimport cv2
import numpy as np
import torchimport torch.nn.functional as torch_Ffrom mobilenet.mobilenetv4 import MobileNetV4import time
import osuse_gpu = torch.cuda.is_available()class TimeStr:def __init__(self):self.last_time, self.counter = '', 0def get_time(self, fmt="%m%d_%H%M_%S"):now_time = time.strftime(fmt)self.counter += 1if now_time != self.last_time:self.last_time