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.
Hello, I did as told, and saved the model in CPU mode. But, that error went away, and a new one came
Unknown nn class "nn.LogSoftMax" in function readTorchObject
I assume this class is not yet supported yet. Can you provide me an alternative?