Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental operator debug spew to std::cerr #2239

Closed
fdwr opened this issue Aug 14, 2019 · 5 comments
Closed

Experimental operator debug spew to std::cerr #2239

fdwr opened this issue Aug 14, 2019 · 5 comments
Milestone

Comments

@fdwr
Copy link
Contributor

fdwr commented Aug 14, 2019

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;
@fdwr
Copy link
Contributor Author

fdwr commented Aug 14, 2019

FYI @linkerzhang, @faxu.

@linkerzhang
Copy link
Member

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

@askhade
Copy link
Contributor

askhade commented Aug 11, 2020

It was decided to stop the checker if it encounters a model with experimental op : PR #2783
FYI: @jcwchen

@askhade
Copy link
Contributor

askhade commented Jun 18, 2021

Lets fix this in onnx 1.10... I will send out a PR

@askhade
Copy link
Contributor

askhade commented Nov 12, 2021

Closing this as a duplicate of #3696.

@askhade askhade closed this as completed Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants