大家好,
我在从源代码构建 PyTorch 时遇到问题。我按照官方构建说明进行操作。我使用 Anaconda Python 3.7.1(版本 2018.12,构建 py37_0)。我安装了所有必要的依赖项conda并发出 python setup.py install命令来构建它。它成功构建了所有文件,但在安装步骤中失败,说:
build/temp.linux-x86_64-3.7/torch/csrc/stub.o: file not recognized: file format not recognized
Run Code Online (Sandbox Code Playgroud)
我尝试使用 gcc/g++ 版本 5、6、7 进行构建,但没有帮助。你能帮我解决这个问题吗?
这是python setup.py install我得到的错误的输出:
[manjaro-pc pytorch]# python setup.py install
Building wheel torch-1.1.0a0+44809fd
-- Building version 1.1.0a0+44809fd
[0/1] Install the project...
-- Install configuration: "Release"
running install
running build
running build_py
copying torch/version.py -> build/lib.linux-x86_64-3.7/torch
copying caffe2/proto/caffe2_pb2.py -> build/lib.linux-x86_64-3.7/caffe2/proto
copying caffe2/proto/caffe2_legacy_pb2.py -> build/lib.linux-x86_64-3.7/caffe2/proto …Run Code Online (Sandbox Code Playgroud)