Open Kavan72 opened 3 years ago
Can you please share the minimum code example that I can use to reproduce this issue?
#[warn(unused_imports)]
#[warn(dead_code)]
use opencv::prelude::*;
use std::error::Error;
use tensorflow;
fn main() -> Result<(), Box<dyn Error>> {
print!("{}", tensorflow::version().unwrap());
let mut img = opencv::imgcodecs::imread(
"/home/kavan/Downloads/test.jpeg",
opencv::imgcodecs::IMREAD_GRAYSCALE
);
Ok(())
}
here is my main.rs
file
[package]
name = "load_model_in_rust"
version = "0.1.0"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
tensorflow = { git = "https://github.com/tensorflow/rust.git" }
opencv = { git = "https://github.com/twistedfall/opencv-rust.git" }
here is my Cargo.toml
file
I can confirm the issue, that's really weird indeed. It's reproducible using the repository version of OpenCV under Ubuntu 20.08, but I can't reproduce it on my local machine for example. There is even no need to call any tensorflow functions, just use tensorflow;
is enough. I'll try to investigate it.
I've run into this same issue on arch linux using the opencv from pacman, but if I build opencv myself and link that in it works fine.
hi @twistedfall any news about this bug?
@slavb18 Not really, it's a very difficult thing to debug. Workaround by building the OpenCV from source should work
I'm getting
segmentation fault (core dumped)
while reading image from path usingimread
. i've noticed weird thing if i importtensorflow
lib then only i'm getting this errorand if i remove
imread
code and just printtensorflow
version using this linethen it's working fine