tensorflow / rust

Rust language bindings for TensorFlow
Apache License 2.0
5.19k stars 422 forks source link

SIGSEGV on use tensorflow #373

Closed mbajlo closed 2 years ago

mbajlo commented 2 years ago

Hello, I am have been trying to setup the example mobilenetv3. In my Cargo.toml I have dependecy tensorflow = { version = "0.19.0" }, up to this point I can make cargo build and it works fine. The problem happens if I add any kind of use tensorflow::, after this if I do build, even though I haven't used any object from tensorflow I get this: Stop reason: signal SIGSEGV: invalid address (fault address: 0x0).

So basically I get segmentation fault, which means I want to use some undefined memory even before I used any code from tensorflow crate. Do you guys know what could be wrong here?

adamcrume commented 2 years ago

I'm unable to reproduce the issue, even running under valgrind. Can you verify which TensorFlow library is getting pulled in? You can try building with -v if it's not clear. You might also want to try running the example with gdb and printing a backtrace (bt) when it crashes.

mbajlo commented 2 years ago

Thanks for a response, I will try what you have explained.

Now when I look at the code I see I have forgotten to remove async main function under the tokio framework. Maybe the problem lies there since there is no async support in tensorflow? I just copied the whole example into the async main