Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: Failed building wheel for torch-asg #7

Closed
mmbejani opened this issue Jun 13, 2021 · 2 comments
Closed

ERROR: Failed building wheel for torch-asg #7

mmbejani opened this issue Jun 13, 2021 · 2 comments

Comments

@mmbejani
Copy link

I just clone the repo. and install the package by pip but I got the following error:

ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-0cn5881m/setup.py'"'"'; file='"'"'/tmp/pip-req-build-0cn5881m/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-f6sihhxy
cwd: /tmp/pip-req-build-0cn5881m/
Complete output (48 lines):
/home/fsuser/.local/lib/python3.6/site-packages/setuptools/dist.py:502: UserWarning: The version specified ('') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
"details." % version
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/torch_asg
copying torch_asg/init.py -> build/lib.linux-x86_64-3.6/torch_asg
copying torch_asg/asg.py -> build/lib.linux-x86_64-3.6/torch_asg
running build_ext
/home/fsuser/.local/lib/python3.6/site-packages/torch/utils/cpp_extension.py:369: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
warnings.warn(msg.format('we could not find ninja.'))
building 'torch_asg_native' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/torch_asg
creating build/temp.linux-x86_64-3.6/torch_asg/native
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/fsuser/.local/lib/python3.6/site-packages/torch/include -I/home/fsuser/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/fsuser/.local/lib/python3.6/site-packages/torch/include/TH -I/home/fsuser/.local/lib/python3.6/site-packages/torch/include/THC -I/usr/include/python3.6m -c torch_asg/native/utils.cpp -o build/temp.linux-x86_64-3.6/torch_asg/native/utils.o -O2 -DTORCH_ASG_SUPPORTS_CUDA -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -DTORCH_EXTENSION_NAME=torch_asg_native -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/fsuser/.local/lib/python3.6/site-packages/torch/include -I/home/fsuser/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/fsuser/.local/lib/python3.6/site-packages/torch/include/TH -I/home/fsuser/.local/lib/python3.6/site-packages/torch/include/THC -I/usr/include/python3.6m -c torch_asg/native/force_aligned_lattice.cpp -o build/temp.linux-x86_64-3.6/torch_asg/native/force_aligned_lattice.o -O2 -DTORCH_ASG_SUPPORTS_CUDA -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -DTORCH_EXTENSION_NAME=torch_asg_native -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/fsuser/.local/lib/python3.6/site-packages/torch/include -I/home/fsuser/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/fsuser/.local/lib/python3.6/site-packages/torch/include/TH -I/home/fsuser/.local/lib/python3.6/site-packages/torch/include/THC -I/usr/include/python3.6m -c torch_asg/native/fully_connected_lattice.cpp -o build/temp.linux-x86_64-3.6/torch_asg/native/fully_connected_lattice.o -O2 -DTORCH_ASG_SUPPORTS_CUDA -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -DTORCH_EXTENSION_NAME=torch_asg_native -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
torch_asg/native/fully_connected_lattice.cpp: In function ‘std::tuple<at::Tensor, at::Tensor> torch_asg::fully_connected_derivative(at::Tensor&, at::Tensor&, at::Tensor&, int64_t, int64_t, int64_t)’:
torch_asg/native/fully_connected_lattice.cpp:60:72: error: call of overloaded ‘sum()’ is ambiguous
masked_softmax(path_contrib, 3)).sum({0, 1});
^
In file included from /home/fsuser/.local/lib/python3.6/site-packages/torch/include/ATen/Tensor.h:3:0,
from /home/fsuser/.local/lib/python3.6/site-packages/torch/include/ATen/Context.h:4,
from /home/fsuser/.local/lib/python3.6/site-packages/torch/include/ATen/ATen.h:9,
from /home/fsuser/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
from /home/fsuser/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
from /home/fsuser/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
from /home/fsuser/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
from /home/fsuser/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
from /home/fsuser/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
from /home/fsuser/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
from /home/fsuser/.local/lib/python3.6/site-packages/torch/include/torch/extension.h:4,
from torch_asg/native/utils.h:8,
from torch_asg/native/fully_connected_lattice.h:8,
from torch_asg/native/fully_connected_lattice.cpp:4:
/home/fsuser/.local/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:972:10: note: candidate: at::Tensor at::Tensor::sum(c10::IntArrayRef, bool, c10::optionalc10::ScalarType) const
Tensor sum(IntArrayRef dim, bool keepdim=false, c10::optional dtype=c10::nullopt) const;
^~~
/home/fsuser/.local/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:973:10: note: candidate: at::Tensor at::Tensor::sum(at::DimnameList, bool, c10::optionalc10::ScalarType) const
Tensor sum(DimnameList dim, bool keepdim=false, c10::optional dtype=c10::nullopt) const;
^~~
torch_asg/native/fully_connected_lattice.cpp:62:41: error: could not convert ‘{grad_transition, grad_inputs}’ from ‘’ to ‘std::tuple<at::Tensor, at::Tensor>’
return {grad_transition, grad_inputs};
^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

ERROR: Failed building wheel for torch-asg

@ariefsaferman
Copy link

face the same error, anyone got the idea how to fix this?

@ariefsaferman
Copy link

Fix the issue by using torch 1.2.0 and torchvision 0.8.0 (I forgot) you can check the website of pytoch to see the matchup torch 1.2.0 and the torchvision version that match with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants