Coder Social home page Coder Social logo

Error of torchac. about l3c-pytorch HOT 27 CLOSED

fab-jul avatar fab-jul commented on July 16, 2024
Error of torchac.

from l3c-pytorch.

Comments (27)

fab-jul avatar fab-jul commented on July 16, 2024

This is weird! Did you try removing the extra_compile_args argument in setup.py L67? Which platform do you use?

from l3c-pytorch.

wensihan avatar wensihan commented on July 16, 2024

My platform is Linux.
I have tried to remove the extra_compile_args argument in setup.py L67. The error still exist.
(pytorch) [wency@localhost torchac]$ COMPILE_CUDA=no python setup.py
Compiling, cuda_support=False
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: no commands supplied

from l3c-pytorch.

fab-jul avatar fab-jul commented on July 16, 2024

Does it work with COMPILE_CUDA=no python setup.py compile. Maybe I made a mistake in the README.

from l3c-pytorch.

wensihan avatar wensihan commented on July 16, 2024

It seems that it doesn't work...
(pytorch) [wency@localhost torchac]$ COMPILE_CUDA=no python setup.py compile
Compiling, cuda_support=False
/home/wency/anaconda3/envs/pytorch/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'extra_compile_args'
warnings.warn(msg)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: invalid command 'compile'

from l3c-pytorch.

fab-jul avatar fab-jul commented on July 16, 2024

Sorry, I meant COMPILE_CUDA=no python setup.py install. does that work?

from l3c-pytorch.

wensihan avatar wensihan commented on July 16, 2024

(pytorch) [wency@localhost torchac]$ COMPILE_CUDA=no python setup.py install
Compiling, cuda_support=False
/home/wency/anaconda3/envs/pytorch/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'extra_compile_args'
warnings.warn(msg)
running install
running bdist_egg
running egg_info
creating torchac_backend_cpu.egg-info
writing torchac_backend_cpu.egg-info/PKG-INFO
writing dependency_links to torchac_backend_cpu.egg-info/dependency_links.txt
writing top-level names to torchac_backend_cpu.egg-info/top_level.txt
writing manifest file 'torchac_backend_cpu.egg-info/SOURCES.txt'
reading manifest file 'torchac_backend_cpu.egg-info/SOURCES.txt'
writing manifest file 'torchac_backend_cpu.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
/home/wency/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/utils/cpp_extension.py:191: UserWarning:

                           !! WARNING !!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Your compiler (g++ 4.8.5) may be ABI-incompatible with PyTorch!
Please use a compiler that is ABI-compatible with GCC 4.9 and above.
See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html.

See https://gist.github.com/goldsborough/d466f43e8ffc948ff92de7486c5216d6
for instructions on how to install GCC 4.9 or higher.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                          !! WARNING !!

warnings.warn(ABI_INCOMPATIBILITY_WARNING.format(compiler))
building 'torchac_backend_cpu' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/home
creating build/temp.linux-x86_64-3.7/home/wency
creating build/temp.linux-x86_64-3.7/home/wency/L3C-PyTorch
creating build/temp.linux-x86_64-3.7/home/wency/L3C-PyTorch/src
creating build/temp.linux-x86_64-3.7/home/wency/L3C-PyTorch/src/torchac
creating build/temp.linux-x86_64-3.7/home/wency/L3C-PyTorch/src/torchac/torchac_backend
gcc -pthread -B /home/wency/anaconda3/envs/pytorch/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/wency/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/include -I/home/wency/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/wency/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/include/TH -I/home/wency/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/include/THC -I/home/wency/anaconda3/envs/pytorch/include/python3.7m -c /home/wency/L3C-PyTorch/src/torchac/torchac_backend/torchac.cpp -o build/temp.linux-x86_64-3.7/home/wency/L3C-PyTorch/src/torchac/torchac_backend/torchac.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=torchac_backend_cpu -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option \u2018-Wstrict-prototypes\u2019 is valid for C/ObjC but not for C++ [enabled by default]
creating build/lib.linux-x86_64-3.7
g++ -pthread -shared -B /home/wency/anaconda3/envs/pytorch/compiler_compat -L/home/wency/anaconda3/envs/pytorch/lib -Wl,-rpath=/home/wency/anaconda3/envs/pytorch/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/home/wency/L3C-PyTorch/src/torchac/torchac_backend/torchac.o -o build/lib.linux-x86_64-3.7/torchac_backend_cpu.cpython-37m-x86_64-linux-gnu.so
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
copying build/lib.linux-x86_64-3.7/torchac_backend_cpu.cpython-37m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg
creating stub loader for torchac_backend_cpu.cpython-37m-x86_64-linux-gnu.so
byte-compiling build/bdist.linux-x86_64/egg/torchac_backend_cpu.py to torchac_backend_cpu.cpython-37.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying torchac_backend_cpu.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying torchac_backend_cpu.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying torchac_backend_cpu.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying torchac_backend_cpu.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
pycache.torchac_backend_cpu.cpython-37: module references file
creating dist
creating 'dist/torchac_backend_cpu-1.0.0-py3.7-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing torchac_backend_cpu-1.0.0-py3.7-linux-x86_64.egg
creating /home/wency/anaconda3/envs/pytorch/lib/python3.7/site-packages/torchac_backend_cpu-1.0.0-py3.7-linux-x86_64.egg
Extracting torchac_backend_cpu-1.0.0-py3.7-linux-x86_64.egg to /home/wency/anaconda3/envs/pytorch/lib/python3.7/site-packages
Adding torchac-backend-cpu 1.0.0 to easy-install.pth file

Installed /home/wency/anaconda3/envs/pytorch/lib/python3.7/site-packages/torchac_backend_cpu-1.0.0-py3.7-linux-x86_64.egg
Processing dependencies for torchac-backend-cpu==1.0.0
Finished processing dependencies for torchac-backend-cpu==1.0.0

With the command, it seems that I have install the torchac. While when I test with the following command, it turn out to be wrong...

(pytorch) [wency@localhost torchac]$ python -c 'import torchac'
*** ERROR: torchac_backend not found. Please see README.

It seems I am failed again.

from l3c-pytorch.

fab-jul avatar fab-jul commented on July 16, 2024

(Please use backticks for the future to make rading easer, see formatting.)

The problem now is likely

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Your compiler (g++ 4.8.5) may be ABI-incompatible with PyTorch!
Please use a compiler that is ABI-compatible with GCC 4.9 and above.
See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html.

See https://gist.github.com/goldsborough/d466f43e8ffc948ff92de7486c5216d6
for instructions on how to install GCC 4.9 or higher.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Do you have a newer GCC available on your system?

from l3c-pytorch.

fab-jul avatar fab-jul commented on July 16, 2024

If you have it somewhere, you can prepend to path. E.g. on my system I do

export PATH=~/compilers/gcc/gcc-5.5.0/bin:$PATH
export COMPILE_CUDA=auto
python setup.py install;

from l3c-pytorch.

fab-jul avatar fab-jul commented on July 16, 2024

Probably, the problem discussed in #4 is also relevant here. Can you try the solution posted there?

from l3c-pytorch.

fab-jul avatar fab-jul commented on July 16, 2024

I'm closing this now, re-open if there are still problems.

from l3c-pytorch.

smileformylove avatar smileformylove commented on July 16, 2024

Hi!@fab-jul I met the same problems! *** ERROR: torchac_backend not found. Please see README.
I tried the gcc-5 and it failed! And solution in #4 also does not work!

from l3c-pytorch.

fab-jul avatar fab-jul commented on July 16, 2024

Hi, which command did you try to compile and what is the exact error message?

from l3c-pytorch.

smileformylove avatar smileformylove commented on July 16, 2024

COMPILE_CUDA=auto python setup.py install for cpu
and COMPILE_CUDA=force python setup.py install for gpu

error:
when i run l3c.py, it has:
*** ERROR: torchac_backend not found. Please see README.
and when i import torchac_backend_cpu in python env, it has:
ImportError:xxxx.so, undefined symbol:_ZN2at19undefinedTensorImpl10_singletonE

from l3c-pytorch.

fab-jul avatar fab-jul commented on July 16, 2024

And what about the compile command? What‘s the output there?

from l3c-pytorch.

fab-jul avatar fab-jul commented on July 16, 2024

Also, which version of pytorch do you have?

from l3c-pytorch.

smileformylove avatar smileformylove commented on July 16, 2024

sorry for bothering u again! my pytorch is 1.0.1!
compile command is COMPILE_CUDA=auto python setup.py install according to readme! and output is:
`COMPILE_CUDA=auto python setup.py install
Found CUDA supported: False
Compiling, cuda_support=False
/home/xxx/anaconda3/envs/py36/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'extra_compile_args'
warnings.warn(msg)
running install
running bdist_egg
running egg_info
creating torchac_backend_cpu.egg-info
writing torchac_backend_cpu.egg-info/PKG-INFO
writing dependency_links to torchac_backend_cpu.egg-info/dependency_links.txt
writing top-level names to torchac_backend_cpu.egg-info/top_level.txt
writing manifest file 'torchac_backend_cpu.egg-info/SOURCES.txt'
reading manifest file 'torchac_backend_cpu.egg-info/SOURCES.txt'
writing manifest file 'torchac_backend_cpu.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
building 'torchac_backend_cpu' extension
gcc -pthread -B /home/xxx/anaconda3/envs/py36/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/xxx/anaconda3/envs/py36/lib/python3.6/site-packages/torch/lib/include -I/home/xxx/anaconda3/envs/py36/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -I/home/xxx/anaconda3/envs/py36/lib/python3.6/site-packages/torch/lib/include/TH -I/home/xxx/anaconda3/envs/py36/lib/python3.6/site-packages/torch/lib/include/THC -I/home/xxx/anaconda3/envs/py36/include/python3.6m -c /home/xxx/Desktop/compression-master/L3C-PyTorch-master/src/torchac/torchac_backend/torchac.cpp -o build/temp.linux-x86_64-3.6/home/xxx/Desktop/compression-master/L3C-PyTorch-master/src/torchac/torchac_backend/torchac.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=torchac_backend_cpu -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
g++ -pthread -shared -B /home/xxx/anaconda3/envs/py36/compiler_compat -L/home/xxx/anaconda3/envs/py36/lib -Wl,-rpath=/home/xxx/anaconda3/envs/py36/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.6/home/xxx/Desktop/compression-master/L3C-PyTorch-master/src/torchac/torchac_backend/torchac.o -o build/lib.linux-x86_64-3.6/torchac_backend_cpu.cpython-36m-x86_64-linux-gnu.so
creating build/bdist.linux-x86_64/egg
copying build/lib.linux-x86_64-3.6/torchac_backend_cpu.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg
copying build/lib.linux-x86_64-3.6/torchac_backend_gpu.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg
creating stub loader for torchac_backend_cpu.cpython-36m-x86_64-linux-gnu.so
byte-compiling build/bdist.linux-x86_64/egg/torchac_backend_cpu.py to torchac_backend_cpu.cpython-36.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying torchac_backend_cpu.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying torchac_backend_cpu.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying torchac_backend_cpu.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying torchac_backend_cpu.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
pycache.torchac_backend_cpu.cpython-36: module references file
creating 'dist/torchac_backend_cpu-1.0.0-py3.6-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing torchac_backend_cpu-1.0.0-py3.6-linux-x86_64.egg
creating /home/xxx/anaconda3/envs/py36/lib/python3.6/site-packages/torchac_backend_cpu-1.0.0-py3.6-linux-x86_64.egg
Extracting torchac_backend_cpu-1.0.0-py3.6-linux-x86_64.egg to /home/xxx/anaconda3/envs/py36/lib/python3.6/site-packages
Adding torchac-backend-cpu 1.0.0 to easy-install.pth file

Installed /home/xxx/anaconda3/envs/py36/lib/python3.6/site-packages/torchac_backend_cpu-1.0.0-py3.6-linux-x86_64.egg
Processing dependencies for torchac-backend-cpu==1.0.0
Finished processing dependencies for torchac-backend-cpu==1.0.0
`

from l3c-pytorch.

fab-jul avatar fab-jul commented on July 16, 2024

So to me the previous error sounds like it could be related to your pytorch version. Could you try with 1.1? See README.

from l3c-pytorch.

smileformylove avatar smileformylove commented on July 16, 2024

Oh!, Maybe i found the reason, nvcc is 5.5 not 9.

from l3c-pytorch.

fab-jul avatar fab-jul commented on July 16, 2024

Could also be. You can also try with COMPILE_CUDA=no iirc

But using pytorch 1.1 is also important I think.

from l3c-pytorch.

fab-jul avatar fab-jul commented on July 16, 2024

Did you get it to run?

from l3c-pytorch.

smileformylove avatar smileformylove commented on July 16, 2024

:(
I use pytorch1.1 and it does not work. nvcc=9 is also not right.
But i do not know what is iirc

You can also try with COMPILE_CUDA=no iirc

from l3c-pytorch.

fab-jul avatar fab-jul commented on July 16, 2024

iirc == if I recall correctly

what I meant is you can try to compile with

COMPILE_CUDA=no python setup.py install

from l3c-pytorch.

fab-jul avatar fab-jul commented on July 16, 2024

What does pip list show? And I think the compilation is actually fine, the problem seems to be the

ImportError:xxxx.so, undefined symbol:_ZN2at19undefinedTensorImpl10_singletonE

which sounds like there is some incorrect static library somewhere. not sure which or what. you could also try the fix used in the pull request #19.

from l3c-pytorch.

smileformylove avatar smileformylove commented on July 16, 2024

pip list is normal. So i think compilation is also fine. And COMPILE_CUDA=no can't help me.

All in all, i will try the solution in the pull request #19.

from l3c-pytorch.

fab-jul avatar fab-jul commented on July 16, 2024

Ok, keep me posted!

from l3c-pytorch.

smileformylove avatar smileformylove commented on July 16, 2024

Thanks God! I finally solve this problem with #https://github.com/caoscott/SReC/blob/master/INSTALL.md.

from l3c-pytorch.

fab-jul avatar fab-jul commented on July 16, 2024

FYI, I released this as a standalone library that does not need CUDA here: https://github.com/fab-jul/torchac

from l3c-pytorch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.