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

Can't run ort with opencv #145

Closed
yevhen-k opened this issue Jan 19, 2024 · 4 comments
Closed

Can't run ort with opencv #145

yevhen-k opened this issue Jan 19, 2024 · 4 comments

Comments

@yevhen-k
Copy link

yevhen-k commented Jan 19, 2024

Can't run ort 2.0.0-alpha.4 with opencv 0.88.7 on my linux machine (haven't tried win/mac). Here is the simplest set up for repro.

sample.rs

use opencv;
use ort;
use tracing_subscriber;

fn main() -> Result<(), Box<dyn std::error::Error>> { Ok(()) }

Cargo.toml

[package]
# ...
edition = "2021"

[[bin]]
name = "sample"
path = "src/sample.rs"

[dependencies]
opencv = { version = "0.88.7" }
ort = "2.0.0-alpha.4"
tracing-subscriber = { version = "0.3.18", features = ["env-filter", "fmt"] }

Compilation

RUST_LOG="ort=debug" cargo run --bin sample
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
E0000 00:00:1705669118.540041   29440 descriptor_database.cc:633] File already exists in database: 
F0000 00:00:1705669118.540077   29440 descriptor.cc:2120] Check failed: GeneratedDatabase()->Add(encoded_file_descriptor, size) 
*** Check failure stack trace: ***
[1]    29440 IOT instruction (core dumped)  RUST_LOG="ort=debug" cargo run --bin sample
@yevhen-k yevhen-k changed the title Can't compile ort with opencv Can't run ort with opencv Jan 19, 2024
@decahedron1
Copy link
Member

Sorry but this isn't anything ort can fix.

See here: https://groups.google.com/g/protobuf/c/RZRCnOywdSk/m/s5QvifLCBgAJ

It seems like OpenCV and ONNX Runtime are both using protobuf with reflection. I don't think it can be disabled in either library.

@decahedron1 decahedron1 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 19, 2024
@yevhen-k
Copy link
Author

Does it mean we won't be able to use both of these packages in a single project in the future?

@decahedron1
Copy link
Member

Probably not, unless you can compile either OpenCV or ONNX Runtime to disable the problematic protobufs.

@TDiblik
Copy link

TDiblik commented Apr 12, 2024

Hey, just heads-up, this is no longer true. I've managed to get it working on both Linux and Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants