Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Unknown type "CudaLong" of torch class "torch.CudaLongTensor") in parseTorchType

I have a trained torch model that I am trying to import in OpenCV. Upon importing the model by

dnn::Net net = dnn::readNetFromTorch(modelFile);

I get the following error:

OpenCV Error: The function/feature is not implemented (Unknown type "CudaLong" of torch class "torch.CudaLongTensor") in parseTorchType, file /home/anomaly_/opencv-base/opencv_contrib/modules/dnn/src/torch/torch_importer.cpp, line 213 terminate called after throwing an instance of 'cv::Exception' what(): /home/anomaly_/opencv-base/opencv_contrib/modules/dnn/src/torch/torch_importer.cpp:213: error: (-213) Unknown type "CudaLong" of torch class "torch.CudaLongTensor" in function parseTorchType

Why do I get this error? Is it because of my trained model? What should I do so that my model is successfully imported?

I am using the latest opencv and opencv_contrib module.