I am trying to use the tch crate for rust but I am getting the following error or run.
Creating library C:\Users\sefto\Documents\rust-projects\tch-test\target\debug\deps\tch_test.lib and object C:\Users\sefto\Documents\rust-projects\tch-test\target\debug\deps\tch_test.exp
libtorch_sys-457a9014c45a8ec4.rlib(torch_api.o) : error LNK2001: unresolved external symbol __imp___tls_index_?init@?1??lazy_init_num_threads@internal@at@@YAXXZ@4_NA
libtorch_sys-457a9014c45a8ec4.rlib(torch_api.o) : error LNK2001: unresolved external symbol __imp___tls_offset_?init@?1??lazy_init_num_threads@internal@at@@YAXXZ@4_NA
C:\Users\sefto\Documents\rust-projects\tch-test\target\debug\deps\tch_test.exe : fatal error LNK1120: 2 unresolved externals
This is after running the following commands:
cargo new tch-test
cd tch-test
cargo add tch
Then changing the contents of main.rs to:
use tch::*;
fn main() {
println!("Hello, world!");
}
and finally running:
cargo run
I have tried installing libtorch and adding to PATH etc as per the install instructions here https://github.com/LaurentMazare/tch-rs.
I have also tried without libtorch as if it is not found cargo should install it for me.