So I’m trying to load a certain ONNX model in OpenCV (started in PyTorch), but it crashes with this error:
OpenCV(4.1.0) Error: Assertion failed (inputs.size()) in cv::dnn::dnn4_v20190122::Layer::getMemoryShapes, file c:\build\master_winpack-build-win64-vc15\opencv\modules\dnn\src\dnn.cpp, line 3616
It gives me this error when I try to convert that ONNX model to Tensorflow:
ValueError: Tensor conversion requested dtype float32 for Tensor with dtype int64: 'Tensor("Mul_3:0", shape=(), dtype=int64)'
I suppose this is why it isn’t working in OpenCV, is there any way to cast the int64 Tensor to a float32 one? I can try to modify the float32 <-> float16 conversion function so that it can also convert int64 to float16, but think this could be quite complex or impossible (I would have to move the weight up by 19 digits?).
So I’m basically asking how I could cast at int64 to a float32 in an existing pre-trained Pytorch model, while getting the same result in the neural network (don’t want to retrain it)