[Bug Fix] When loading model from memory, don't need CheckModelFormat (#1073)

When loading model from memory, don't need CheckModelFormat
This commit is contained in:
huangjianhui
2023-01-06 13:48:44 +08:00
committed by GitHub
parent d7a65e5c70
commit c8d2fef198

View File

@@ -140,9 +140,11 @@ bool FastDeployModel::InitRuntimeWithSpecifiedDevice() {
}
bool FastDeployModel::InitRuntime() {
FDASSERT(
CheckModelFormat(runtime_option.model_file, runtime_option.model_format),
"ModelFormatCheck Failed.");
if (!runtime_option.model_from_memory_) {
FDASSERT(
CheckModelFormat(runtime_option.model_file, runtime_option.model_format),
"ModelFormatCheck Failed.");
}
if (runtime_initialized_) {
FDERROR << "The model is already initialized, cannot be initliazed again."
<< std::endl;