megvii-research / TreeEnergyLoss

[CVPR2022] Tree Energy Loss: Towards Sparsely Annotated Semantic Segmentation
Other
103 stars 8 forks source link

compile error #12

Open fsted opened 1 year ago

fsted commented 1 year ago

Hi! Thank you for your code. This is a surprising article, but I encountered a confusing compilation error when I run setup.py: /home/anaconda3/compiler_compat/ld: cannot find -lc10 /home/anaconda3/compiler_compat/ld: cannot find -ltorch /home/anaconda3/compiler_compat/ld: cannot find -ltorch_cpu /home/anaconda3/compiler_compat/ld: cannot find -ltorch_python /home/anaconda3/compiler_compat/ld: cannot find -lc10_cuda /home/anaconda3/compiler_compat/ld: cannot find -ltorch_cuda collect2: error: ld returned 1 exit status error: command 'g++' failed with exit status 1 My environment is torch 1.7.1, cuda 10.1, and gcc 7.5. It looks OK, but an error occurs Looking forward your reply!

vniclas commented 1 year ago

For future reference, using a conda environment, I had to run the following command:

LDFLAGS=-L/PATH-TO-YOUR-ENV/lib/python3.8/site-packages/torch/lib python setup.py build develop