pytorch / vision

Datasets, Transforms and Models specific to Computer Vision
https://pytorch.org/vision
BSD 3-Clause "New" or "Revised" License
16.12k stars 6.94k forks source link

Error building C++ backend #1958

Open cnd opened 4 years ago

cnd commented 4 years ago

Trying version 0.5.0 (but same with 0.4.2), first I get:

/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/include/g++-v9/x86_64-pc-linux-gnu/bits/c++config.h:273:27: error: #if with no expression
  273 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^

if I fix it by manually changing makefile and replacing -D_GLIBCXX_USE_CXX11_ABI= with _GLIBCXX_USE_CXX11_ABI=1 I get another errors:

/usr/include/ATen/core/dispatch/Dispatcher.h:211:80: error: redeclaration of ‘at::Tensor& args#0’
  211 |     return kernel.template callUnboxedOnly<Return, Args...>(std::forward<Args>(args)...);
      |                                 
fmassa commented 4 years ago

Hi,

What's your current setup? It looks like you are using gcc 9.2.0?

Also, this seems to be an issue in PyTorch compilation with your setup, so I think you might have more chance getting some help if you create an issue there

fmassa commented 4 years ago

cc @smessmer just in case you happen to know what's happening

cnd commented 4 years ago

yes, gcc 9.2.0, pytorch itself 1.4.0 compiles fine.

fmassa commented 4 years ago

Thanks for the information. I'll see if someone with more experience with the dispatcher knows what is going on

cnd commented 4 years ago

@fmassa was trying different pytorch build and then I get: no member named 'bias' in 'torch::nn::ConvOptions

fmassa commented 4 years ago

@cnd you probably hit an incompatibility of versions, as https://github.com/pytorch/vision/pull/1576 replaced with_bias by bias

cnd commented 4 years ago

@fmassa it looks strange, I'm on 1.4 version of PyTorch and trying 0.5.0 vision, what versions I need to have compatibility?

fmassa commented 4 years ago

@cnd PyTorch 1.4 is compatible with torchvision 0.5.0, except if I missed something for the C++ API during the release.

jinuhwang commented 4 years ago

@cnd I was able to build one from Pytroch 1.4. You might be linking the old ones. Check libtorch in /usr.

fmassa commented 4 years ago

@cnd did you have a chance to try @jinuhwang comment?

cnd commented 4 years ago

Hello, I have it there from 1.4

 * Searching for /usr/lib64/libtorch.so ... 
sci-libs/pytorch-1.4.0_p0 (/usr/lib64/libtorch.so)

(tho not fully sure what's p0)