I am trying to call pytorch code with C++, and the C++ code is called in Qt.
All the things goes right but when the code run:
weight = torch.load('./weights.pth')

Concretely, If i run the C++ and pytorch code without Qt, the program runs correctly. But if the code is implemented in Qt, the weights can not be loaded. By the way, random initialization is ok.
I am confused.
Could someone help me?