transformers.js icon indicating copy to clipboard operation
transformers.js copied to clipboard

env.backends.onnx.logLevel = "fatal"; does not work

Open sroussey opened this issue 1 year ago • 6 comments

System Info

2.14.0 on MacOS node env

Environment/Platform

  • [ ] Website/web-app
  • [ ] Browser extension
  • [X] Server-side (e.g., Node.js, Deno, Bun)
  • [ ] Desktop app (e.g., Electron)
  • [ ] Other (e.g., VSCode extension)

Description

env.backends.onnx.logLevel = "fatal";

This does not have an effect as expected.

When creating a pipeline, in options, setting a config with {log_severity_level:4} works but breaks other things as it is not added to a config, but overwrites it.

Reproduction

I have a nice little download progress bar but I can't see it when it floods with messages like

2024-01-21 20:57:14.104 bun[74866:28886536] 2024-01-21 20:57:14.103988 [W:onnxruntime:, graph.cc:3553 CleanUnusedInitializersAndNodeArgs] Removing initializer '/decoder/block.0/layer.2/DenseReluDense/act/Constant_4_output_0'. It is not used by any node and should be removed from the model.
2024-01-21 20:57:14.104 bun[74866:28886536] 2024-01-21 20:57:14.104000 [W:onnxruntime:, graph.cc:3553 CleanUnusedInitializersAndNodeArgs] Removing initializer '/decoder/block.18/layer.2/DenseReluDense/act/Constant_2_output_0'. It is not used by any node and should be removed from the model.
2024-01-21 20:57:14.104 bun[74866:28886536] 2024-01-21 20:57:14.104009 [W:onnxruntime:, graph.cc:3553 CleanUnusedInitializersAndNodeArgs] Removing initializer '/decoder/block.13/layer.2/DenseReluDense/act/Constant_4_output_0'. It is not used by any node and should be removed from the model.
2024-01-21 20:57:14.104 bun[74866:28886536] 2024-01-21 20:57:14.104019 [W:onnxruntime:, graph.cc:3553 CleanUnusedInitializersAndNodeArgs] Removing initialize

sroussey avatar Jan 22 '24 05:01 sroussey

Just in case it is upstream: https://github.com/microsoft/onnxruntime/issues/19225

sroussey avatar Jan 22 '24 17:01 sroussey

Hi there 👋 Yes, this is a bug with onnxruntime itself, and it has been reported before at #270. This should be fixed once we upgrade to ORT v1.17.

xenova avatar Jan 22 '24 20:01 xenova

Thanks for the update. I used the linked PR in my fork and it seems to work well enough, but looking forward to not needing a fork later. :)

sroussey avatar Jan 22 '24 21:01 sroussey

Upgrading to 1.17 does not fix this problem for onnxruntime-node. I think that flag currently only works for onnxruntime-web. Need a fix.

fs-eire avatar Jan 30 '24 00:01 fs-eire