Import::onnxresizeintoutsize
Details
-
- This message is generated when an imported ONNX model contains a "Resize" operator with a set of specific features. These features include the following constraints: its "coordinate_transformation_mode" must not be set to "align_corners", it must resize its input by a set of fractional scales and the product between the fractional scales and the input dimensions must not be an integer.
- Off[message] switches off the message; On[message] switches it on. For example: Off[Import::onnxresizeintoutsize].
Examples
Basic Examples (1)
Import an ONNX model that generates the message:

The model consists of a single "Resize" operator rescaling its 2-dimensional input by 2 multiplicative factors, one per each dimension. Extract the rescaling factors:
The product is not an integer on the last dimension:
In such a case, the ONNX specification prescribes that the output dimensions should be rounded down, which is what the ResizeLayer resulting from the import procedure does. However, the computation performed by such a ResizeLayer is not what ONNX dictates. This can be checked by comparing the output of the layer with the output of the equivalent NetExternalObject:
NetExternalObject runs a native implementation of the ONNX model and it reflects exactly what the intended computation is. The output of the NetExternalObject is different from the output of the ResizeLayer because the latter carries an error:
The error produced by the ResizeLayer is directly proportional to the fractional part of the product between the input dimensions and the scales. It is zero when such a product is an integer, and no message is produced in such case. Convert an ONNX model that does not trigger the message:
The product between scales and input dimensions is an integer in this case:
For this model, the converted ResizeLayer produces the same results as the NetExternalObject: