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

Unable to build wheel for 0.8.1 #2932

Closed
choidongyeon opened this issue Oct 29, 2020 · 4 comments · Fixed by #2937
Closed

Unable to build wheel for 0.8.1 #2932

choidongyeon opened this issue Oct 29, 2020 · 4 comments · Fixed by #2937

Comments

@choidongyeon
Copy link

choidongyeon commented Oct 29, 2020

🐛 Bug

I am unable to create a wheel from the v0.8.1 tag. I already have pytorch 1.7 installed.

To Reproduce

Steps to reproduce the behavior:

  1. git checkout tags/v0.8.1 -b v0.8.1
  2. python setup.py clean
  3. python setup.py bdist_wheel --universal --plat-name=manylinux1_x86_64 or python setup.py install

The last few couple lines are:

/vision/torchvision/csrc/cpu/video/Video.cpp:337:68: error: converting to ‘std::tuple<at::Tensor, double>’ from initializer list would use explicit constructor ‘constexpr std::tuple<_T1, _T2>::tuple(_U1&&, _U2&&) [with _U1 = at::Tensor&; _U2 = double&; <template-parameter-2-3> = void; _T1 = at::Tensor; _T2 = double]’
   std::tuple<torch::Tensor, double> result = {outFrame, frame_pts_s};
                                                                    ^
error: command 'gcc' failed with exit status 1

A full log can be viewed here: output_bdist_wheel.log.

I am able to build/install v0.7.0 and earlier versions, but am unable to build v0.8.0 and v0.8.1.

Any help would be appreciated. Thanks!

Expected behavior

Creation of a 0.8.1 torchvision binary.

Environment

python -m torch.utils.collect_env
Collecting environment information...
/opt/conda/lib/python3.6/site-packages/torch/cuda/__init__.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at  /pytorch/c10/cuda/CUDAFunctions.cpp:100.)
  return torch._C._cuda_getDeviceCount() > 0
PyTorch version: 1.7.0
Is debug build: True
CUDA used to build PyTorch: 10.2
ROCM used to build PyTorch: N/A

OS: Ubuntu 16.04.7 LTS (x86_64)
GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
Clang version: Could not collect
CMake version: version 3.5.1

Python version: 3.6 (64-bit runtime)
Is CUDA available: False
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==1.16.4
[pip3] torch==1.7.0
[conda] mkl                       2019.4                      243    anaconda
[conda] mkl-include               2019.4                      243    anaconda
[conda] mkl-service               2.3.0            py36he904b0f_0    anaconda
[conda] mkl_random                1.1.0            py36hd6b4f25_0    anaconda
[conda] numpy                     1.16.4           py36h95a1406_0    conda-forge
[conda] torch                     1.7.0                    pypi_0    pypi

Additional context

cc @bjuncek

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Oct 29, 2020

@choidongyeon thanks for the report. I could reproduce your issue inside docker container with Ubuntu 16.04 and gcc 5.4.0.

This should be related to gcc version (5.4.0) as according to C++ ref

std::tuple<int, int> foo_tuple() 
{
  return {1, -1};  // Error until N4387
  return std::tuple<int, int>{1, -1}; // Always works
  return std::make_tuple(1, -1); // Always works
}

Since gcc 6.1 we can use {1, -1} for tuple instantiation.

If we manually replace

- std::tuple<torch::Tensor, double> result = {outFrame, frame_pts_s};
+ std::tuple<torch::Tensor, double> result = std::make_tuple(outFrame, frame_pts_s);

we can build the package.

@vfdev-5 vfdev-5 self-assigned this Oct 30, 2020
vfdev-5 added a commit to Quansight/vision that referenced this issue Oct 30, 2020
- Replaced tuple creation by one acceptable by majority of compilers
fmassa pushed a commit that referenced this issue Oct 30, 2020
- Replaced tuple creation by one acceptable by majority of compilers
@vfdev-5
Copy link
Collaborator

vfdev-5 commented Oct 30, 2020

@choidongyeon recently merged PR #2937 should fix the problem on the master. Please build torchvision from master instead of the tag 0.8.1 and feel free to reopen this issue if it still does not work for you. Thanks

@fmassa
Copy link
Member

fmassa commented Oct 30, 2020

I think we will be building a 1.7.1 release for PyTorch in December, so we might as well have this fix be pushed to the new torchvision release being built (0.8.2).

cc @seemethere the process would be to send cherry-pick PRs to release/0.8.0 branch?

@choidongyeon
Copy link
Author

Thanks @vfdev-5 !

fmassa pushed a commit to fmassa/vision-1 that referenced this issue Nov 16, 2020
- Replaced tuple creation by one acceptable by majority of compilers
fmassa added a commit that referenced this issue Nov 19, 2020
- Replaced tuple creation by one acceptable by majority of compilers

Co-authored-by: vfdev <vfdev.5@gmail.com>
bryant1410 pushed a commit to bryant1410/vision-1 that referenced this issue Nov 22, 2020
- Replaced tuple creation by one acceptable by majority of compilers
vfdev-5 added a commit to Quansight/vision that referenced this issue Dec 4, 2020
- Replaced tuple creation by one acceptable by majority of compilers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants