Closed ouening closed 4 years ago
OS: Win 10 64 Libtorch: 1.6 Visual Studio 2017 (VC15) OpenCV: 4.4 (win pre-build) 使用该库调用最新的libtorch的话会出现接口不兼容的问题,出现下面这些错误:
Darknet.cpp(18): error C2039: “isspace”: 不是“std”的成员
Darknet.cpp(139): error C2039: “with_bias”: 不是“torch::nn::ConvOptions<2>”的成员
Darknet.cpp(146): error C2039: “stateful”: 不是“torch::nn::BatchNormOptions
Darknet.cpp(380): error C2039: “BatchNorm”: 不是“torch::nn”的成员
Darknet.cpp(526): error C2039: “is_variable”: 不是“c10::TensorOptions”的成员
Darknet.cpp(550): error C2039: “BatchNormImpl”: 不是“torch::nn”的成员
相应的解决办法:
其实就是libtorch的接口还不稳定导致不同版本之间不兼容。 另外注意事项:
cmake -G "Visual Studio 15 2017 Win64" -T host=x64 -DCMAKE_PREFIX_PATH="E:\MachineLearn ing\libtorch" ..
最后将修改后的程序托管在地址:https://github.com/ouening/libtorch1.6-yolov3
thanks
OS: Win 10 64 Libtorch: 1.6 Visual Studio 2017 (VC15) OpenCV: 4.4 (win pre-build) 使用该库调用最新的libtorch的话会出现接口不兼容的问题,出现下面这些错误:
Darknet.cpp(18): error C2039: “isspace”: 不是“std”的成员
Darknet.cpp(139): error C2039: “with_bias”: 不是“torch::nn::ConvOptions<2>”的成员
Darknet.cpp(146): error C2039: “stateful”: 不是“torch::nn::BatchNormOptions
Darknet.cpp(380): error C2039: “BatchNorm”: 不是“torch::nn”的成员
Darknet.cpp(526): error C2039: “is_variable”: 不是“c10::TensorOptions”的成员
Darknet.cpp(550): error C2039: “BatchNormImpl”: 不是“torch::nn”的成员
相应的解决办法:
其实就是libtorch的接口还不稳定导致不同版本之间不兼容。 另外注意事项:
cmake -G "Visual Studio 15 2017 Win64" -T host=x64 -DCMAKE_PREFIX_PATH="E:\MachineLearn ing\libtorch" ..
最后将修改后的程序托管在地址:https://github.com/ouening/libtorch1.6-yolov3