From a7b3d2581fe22f2afb9a87782eb1ca1215b5b606 Mon Sep 17 00:00:00 2001 From: Dmitry Kurtaev Date: Mon, 17 Sep 2018 12:31:09 +0300 Subject: [PATCH] Replace CV_USRTYPE1 for int64 to CV_32SC2 in Torch importer --- modules/dnn/src/torch/torch_importer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/dnn/src/torch/torch_importer.cpp b/modules/dnn/src/torch/torch_importer.cpp index 2338c73d96..47aa1cc822 100644 --- a/modules/dnn/src/torch/torch_importer.cpp +++ b/modules/dnn/src/torch/torch_importer.cpp @@ -214,8 +214,8 @@ struct TorchImporter return CV_16S; else if (typeStr == "Int") return CV_32S; - else if (typeStr == "Long") //Carefully! CV_64S type coded as CV_USRTYPE1 - return CV_USRTYPE1; + else if (typeStr == "Long") //Carefully! CV_64S type coded as CV_32SC2 + return CV_32SC2; else CV_Error(Error::StsNotImplemented, "Unknown type \"" + typeStr + "\" of torch class \"" + str + "\""); } @@ -236,7 +236,7 @@ struct TorchImporter void readTorchStorage(int index, int type = -1) { long size = readLong(); - Mat storageMat(1, size, (type != CV_USRTYPE1) ? type : CV_64F); //handle LongStorage as CV_64F Mat + Mat storageMat(1, size, (type != CV_32SC2) ? type : CV_64F); //handle LongStorage as CV_64F Mat switch (type) { @@ -257,7 +257,7 @@ struct TorchImporter case CV_32S: THFile_readIntRaw(file, (int*)storageMat.data, size); break; - case CV_USRTYPE1: + case CV_32SC2: { double *buf = storageMat.ptr(); THFile_readLongRaw(file, (int64*)buf, size);