Onnx: Experimental operator debug spew to std::cerr

Created on 14 Aug 2019  路  3Comments  路  Source: onnx/onnx

When an older experimental operator is encountered, check_node in onnx/checker.cc writes directly to std::cerr (rather than to some more proper logging mechanism) which shows up as direct spew to the user and looks rather unprofessional. For console apps, when loading a model, you see a long paragraph of messages. For a GUI app, this message isn't even seen anyway and isn't useful. Note the operators were already removed in a previous ONNX release, and thus the transitional warning isn't so important.

In the context of ONNX runtime, which continues to support these experimental operators for backwards compatibility of older models, the diagnostic message adds no value and is confusing because they are still supported. If/when the shape inference logic is removed from core ONNX, ONNX runtime can adopt the schema and shape inference functions into itself for compat.

A list of older models affected:

coreml_MNIST.onnx
winmlperf_coreml_FNS-Candy
coreml_VGG16_ImageNet.onnx
cs_generalfeaturizer.onnx
keras2coreml_LSTM_ImageNet.onnx
onnxzoo_winmlperf_tiny_yolov2.onnx
winmlperf_coreml_Inceptionv3
winmlperf_coreml_MobileNet
winmlperf_coreml_SqueezeNet

Operators affected:

ImageScaler, Affine, Crop

Desired action:

Just remove the message.

Alternately: Support a CMakeList define, and #ifdef the block.

Pertinent Code

void check_node(
    const NodeProto& node,
    const CheckerContext& ctx,
    const LexicalScopeContext& lex_ctx
    )
{
...
    if (experimental_ops.count(node.op_type()))
    {
        std::cerr << "Warning: " << node.op_type() << " was a removed "
                  << "experimental op. In the future, we may directly "
                  << "reject this operator. Please update your model as soon "
                  << "as possible." << std::endl;
onnx checker

Most helpful comment

It was decided to stop the checker if it encounters a model with experimental op : PR https://github.com/onnx/onnx/pull/2783
FYI: @jcwchen

All 3 comments

FYI @linkerzhang, @faxu.

this error message could be removed given exp ops has been removed since 1.5. Let's remove it in 1.6.

It was decided to stop the checker if it encounters a model with experimental op : PR https://github.com/onnx/onnx/pull/2783
FYI: @jcwchen

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hariharans29 picture hariharans29  路  4Comments

lukasheinrich picture lukasheinrich  路  3Comments

radikalliberal picture radikalliberal  路  3Comments

RanyaJumah picture RanyaJumah  路  3Comments

buddhapuneeth picture buddhapuneeth  路  3Comments