fab-jul/L3C-PyTorch

torchac installed but still error torchac backend not found

vainaixr opened this issue · 8 comments

python -c "import torchac" gives no error

but

python l3c.py ../../L3C 0524_0001 enc ../figs out.l3c

gives error torchac_backend not found.

gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0

Are you sure you are running in the same environment? I.e. what does pip list show? Can you obtain a stacktrace by replacing the line

print('*** ERROR: torchac_backend not found. Please see README.')

in torchac/torchac.py, with

raise ImportError('*** ERROR: torchac_backend not found. Please see README.')

import torchac_backend_cpu as torchac_backend
ImportError: /home/vainaijr/anaconda3/envs/l3c_env/lib/python3.7/site-packages/torchac_backend_cpu-1.0.0-py3.7-linux-x86_64.egg/torchac_backend_cpu.cpython-3
7m-x86_64-linux-gnu.so: undefined symbol: _Z8free_cdfPt

import torchac_backend_gpu as torchac_backend
ModuleNotFoundError: No module named 'torchac_backend_gpu'

I seem to meet the same problem.
I installed the torchac successfully(COMPILE_CUDA=auto python setup.py install).
But I can't import torchac_backend_cpu now.
I have no idea if it is just because my GCC version is 5.4(ubuntu16.04)

I have the same problem, With CUDA its working. But with CPU its not working. Someone is working on this?

Hi all. Sorry for the inconvenience -- sadly I don't have a lot of experience with compiling custom PyTorch modules :)

BUT, I think I found the problem!! It probably crept in very shortly before release, and is L36 in torchac.cpp. There, I define COMPILE_CUDA even though that should only be defined by setup.py. (The idea is that setup.py sets this to change compilation).

Anyway, please try:

  1. Remove this line
  2. Uninstall any backends you installed: (pip uninstall torchac-backend-cpu and/or pip uninstall torchac-backend-gpu)
  3. Recompile

Let me know if it helps!

I also fixed in the repo now: 7565c04

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

I just pushed another bug fix: 22e1aa4