protected void save(string strModel, string strSolver, bool bDeploy) { string strPath = m_strBaseDir + "\\models\\test\\"; if (!Directory.Exists(strPath)) { Directory.CreateDirectory(strPath); } string strModelFile = null; string strSolverFile = null; string strType = (bDeploy) ? "deploy" : "train_val"; if (m_strName.Contains("SSD")) { strModelFile = strPath + "ssd_" + strType + ".prototxt"; if (strSolver != null) { strSolverFile = strPath + "ssd_solver.prototxt"; } } else if (m_strName.Contains("ResNet")) { ResNetModelBuilder.MODEL model = ResNetModelBuilder.MODEL.RESNET101; if (m_strName.Contains("152")) { model = ResNetModelBuilder.MODEL.RESNET152; } else if (m_strName.Contains("101")) { model = ResNetModelBuilder.MODEL.RESNET101; } else { model = ResNetModelBuilder.MODEL.RESNET56; } // NOTE: These models are big and can require 40+ GB of Video Memory depending on the batch sizes used. if (m_strName.Contains("SIAMESE")) { strModelFile = strPath + model.ToString().ToLower() + "_siamese_" + strType + ".prototxt"; if (strSolver != null) { strSolverFile = strPath + model.ToString().ToLower() + "_siamese_solver.prototxt"; } } else { strModelFile = strPath + model.ToString().ToLower() + "_" + strType + ".prototxt"; if (strSolver != null) { strSolverFile = strPath + model.ToString().ToLower() + "_solver.prototxt"; } } } if (strModelFile != null) { using (StreamWriter sw = new StreamWriter(strModelFile)) { sw.Write(strModel); } } if (strSolverFile != null) { using (StreamWriter sw = new StreamWriter(strSolverFile)) { sw.Write(strSolver); } } }
public ResNetModelBuilderTest(ResNetModelBuilder.MODEL model, bool bSiamese = false, EngineParameter.Engine engine = EngineParameter.Engine.DEFAULT) : base("ResNet Model Builder Test" + ((bSiamese) ? " SIAMESE" : "") + " " + model.ToString(), TestBase.DEFAULT_DEVICE_ID, engine) { }