【发布时间】:2020-07-06 22:02:45
【问题描述】:
现在我正在处理一个需要使用 Pytorch C++ 扩展的项目。 我在 python 虚拟环境中安装了 1.4.0 版本的 Pytorch:
activate crfasrnn
>>>import torch
>>>print(torch.__version__)
1.4.0
我使用 Visual Studio 作为 C++ 编译器。 代码是这样的:
#include<iostream>
#include<torch/extension.h>
int main()
{
std::cout << "hello, world!" << std::endl;
return 0;
}
但是,编译器告诉我“无法打开 'torch/extension.h'” 我该如何解决这个问题?
【问题讨论】:
标签: c++ machine-learning computer-vision pytorch