MVIG-SJTU / AlphAction

Spatio-Temporal Action Localization System
407 stars 74 forks source link

安装环境时出错 #64

Open wangjiye7 opened 3 years ago

wangjiye7 commented 3 years ago

(alphaction) root@d21372a9db77:/mnt/AlphAction# pip install -e . Looking in indexes: https://mirrors.aliyun.com/pypi/simple/ Obtaining file:///mnt/AlphAction Requirement already satisfied: tqdm in /root/miniconda3/envs/alphaction/lib/python3.7/site-packages (from alphaction==0.0.0) (4.60.0) Requirement already satisfied: yacs in /root/miniconda3/envs/alphaction/lib/python3.7/site-packages (from alphaction==0.0.0) (0.1.8) Requirement already satisfied: opencv-python in /root/miniconda3/envs/alphaction/lib/python3.7/site-packages (from alphaction==0.0.0) (4.5.1.48) Requirement already satisfied: tensorboardX in /root/miniconda3/envs/alphaction/lib/python3.7/site-packages (from alphaction==0.0.0) (2.2) Requirement already satisfied: SciPy in /root/miniconda3/envs/alphaction/lib/python3.7/site-packages (from alphaction==0.0.0) (1.6.3) Requirement already satisfied: matplotlib in /root/miniconda3/envs/alphaction/lib/python3.7/site-packages (from alphaction==0.0.0) (3.4.1) Requirement already satisfied: cython-bbox in /root/miniconda3/envs/alphaction/lib/python3.7/site-packages (from alphaction==0.0.0) (0.1.3) Requirement already satisfied: easydict in /root/miniconda3/envs/alphaction/lib/python3.7/site-packages (from alphaction==0.0.0) (1.9) Requirement already satisfied: numpy>=1.16 in /root/miniconda3/envs/alphaction/lib/python3.7/site-packages (from matplotlib->alphaction==0.0.0) (1.20.1) Requirement already satisfied: pyparsing>=2.2.1 in /root/miniconda3/envs/alphaction/lib/python3.7/site-packages (from matplotlib->alphaction==0.0.0) (2.4.7) Requirement already satisfied: pillow>=6.2.0 in /root/miniconda3/envs/alphaction/lib/python3.7/site-packages (from matplotlib->alphaction==0.0.0) (8.2.0) Requirement already satisfied: cycler>=0.10 in /root/miniconda3/envs/alphaction/lib/python3.7/site-packages (from matplotlib->alphaction==0.0.0) (0.10.0) Requirement already satisfied: kiwisolver>=1.0.1 in /root/miniconda3/envs/alphaction/lib/python3.7/site-packages (from matplotlib->alphaction==0.0.0) (1.3.1) Requirement already satisfied: python-dateutil>=2.7 in /root/miniconda3/envs/alphaction/lib/python3.7/site-packages (from matplotlib->alphaction==0.0.0) (2.8.1) Requirement already satisfied: six in /root/miniconda3/envs/alphaction/lib/python3.7/site-packages (from cycler>=0.10->matplotlib->alphaction==0.0.0) (1.15.0) Requirement already satisfied: protobuf>=3.8.0 in /root/miniconda3/envs/alphaction/lib/python3.7/site-packages (from tensorboardX->alphaction==0.0.0) (3.15.8) Requirement already satisfied: PyYAML in /root/miniconda3/envs/alphaction/lib/python3.7/site-packages (from yacs->alphaction==0.0.0) (5.4.1) Installing collected packages: alphaction Running setup.py develop for alphaction ERROR: Command errored out with exit status 1: command: /root/miniconda3/envs/alphaction/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/mnt/AlphAction/setup.py'"'"'; file='"'"'/mnt/AlphAction/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' develop --no-deps cwd: /mnt/AlphAction/ Complete output (19 lines): running develop running egg_info writing alphaction.egg-info/PKG-INFO writing dependency_links to alphaction.egg-info/dependency_links.txt writing requirements to alphaction.egg-info/requires.txt writing top-level names to alphaction.egg-info/top_level.txt reading manifest file 'alphaction.egg-info/SOURCES.txt' writing manifest file 'alphaction.egg-info/SOURCES.txt' running build_ext building 'alphaction._custom_cuda_ext' extension gcc -pthread -B /root/miniconda3/envs/alphaction/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/mnt/AlphAction/alphaction/csrc -I/root/miniconda3/envs/alphaction/lib/python3.7/site-packages/torch/include -I/root/miniconda3/envs/alphaction/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/root/miniconda3/envs/alphaction/lib/python3.7/site-packages/torch/include/TH -I/root/miniconda3/envs/alphaction/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/root/miniconda3/envs/alphaction/include/python3.7m -c /mnt/AlphAction/alphaction/csrc/vision.cpp -o build/temp.linux-x86_64-3.7/mnt/AlphAction/alphaction/csrc/vision.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_custom_cuda_ext -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++ /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/mnt/AlphAction/alphaction/csrc -I/root/miniconda3/envs/alphaction/lib/python3.7/site-packages/torch/include -I/root/miniconda3/envs/alphaction/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/root/miniconda3/envs/alphaction/lib/python3.7/site-packages/torch/include/TH -I/root/miniconda3/envs/alphaction/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/root/miniconda3/envs/alphaction/include/python3.7m -c /mnt/AlphAction/alphaction/csrc/cuda/ROIAlign3d_cuda.cu -o build/temp.linux-x86_64-3.7/mnt/AlphAction/alphaction/csrc/cuda/ROIAlign3d_cuda.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options '-fPIC' -O3 -DCUDA_HAS_FP16=1 -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_custom_cuda_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_37,code=sm_37 -std=c++11 In file included from /mnt/AlphAction/alphaction/csrc/cuda/ROIAlign3d_cuda.cu:2:0: /root/miniconda3/envs/alphaction/lib/python3.7/site-packages/torch/include/ATen/cuda/CUDAContext.h:12:10: fatal error: cusparse.h: No such file or directory

include

          ^~~~~~~~~~~~
compilation terminated.
error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1
----------------------------------------

ERROR: Command errored out with exit status 1: /root/miniconda3/envs/alphaction/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/mnt/AlphAction/setup.py'"'"'; file='"'"'/mnt/AlphAction/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

显示已经安装alphaction了但是conda list中没有显示

(alphaction) root@d21372a9db77:/mnt/AlphAction# conda list

packages in environment at /root/miniconda3/envs/alphaction:

#

Name Version Build Channel

_libgcc_mutex 0.1 main defaults av 7.0.1 py37h82f89c2_2 conda-forge blas 1.0 mkl defaults bzip2 1.0.8 h7b6447c_0 defaults ca-certificates 2021.4.13 h06a4308_1 defaults certifi 2020.12.5 py37h06a4308_0 defaults cudatoolkit 10.1.243 h6bb024c_0 defaults cycler 0.10.0 pypi_0 pypi cython 0.29.23 py37h2531618_0 defaults cython-bbox 0.1.3 pypi_0 pypi easydict 1.9 pypi_0 pypi ffmpeg 4.2.2 h20bf706_0 defaults freetype 2.10.4 h5ab3b9f_0 defaults gmp 6.2.1 h2531618_2 defaults gnutls 3.6.15 he1e5248_0 defaults intel-openmp 2021.2.0 h06a4308_610 defaults jpeg 9b h024ee3a_2 defaults kiwisolver 1.3.1 pypi_0 pypi lame 3.100 h7b6447c_0 defaults lcms2 2.12 h3be6417_0 defaults ld_impl_linux-64 2.33.1 h53a641e_7 defaults libffi 3.3 he6710b0_2 defaults libgcc-ng 9.1.0 hdf63c60_0 defaults libiconv 1.15 h63c8f33_5 defaults libidn2 2.3.0 h27cfd23_0 defaults libopus 1.3.1 h7b6447c_0 defaults libpng 1.6.37 hbc83047_0 defaults libstdcxx-ng 9.1.0 hdf63c60_0 defaults libtasn1 4.16.0 h27cfd23_0 defaults libtiff 4.1.0 h2733197_1 defaults libunistring 0.9.10 h27cfd23_0 defaults libuv 1.40.0 h7b6447c_0 defaults libvpx 1.7.0 h439df22_0 defaults lz4-c 1.9.3 h2531618_0 defaults matplotlib 3.4.1 pypi_0 pypi mkl 2021.2.0 h06a4308_296 defaults mkl-service 2.3.0 py37h27cfd23_1 defaults mkl_fft 1.3.0 py37h42c9631_2 defaults mkl_random 1.2.1 py37ha9443f7_2 defaults ncurses 6.2 he6710b0_1 defaults nettle 3.7.2 hbbd107a_1 defaults ninja 1.10.2 hff7bd54_1 defaults numpy 1.20.1 py37h93e21f0_0 defaults numpy-base 1.20.1 py37h7d8b39e_0 defaults olefile 0.46 py37_0 defaults opencv-python 4.5.1.48 pypi_0 pypi openh264 2.1.0 hd408876_0 defaults openssl 1.1.1k h27cfd23_0 defaults pillow 8.2.0 py37he98fc37_0 defaults pip 21.0.1 py37h06a4308_0 defaults protobuf 3.15.8 pypi_0 pypi pyparsing 2.4.7 pypi_0 pypi python 3.7.10 hdb3f193_0 defaults python-dateutil 2.8.1 pypi_0 pypi python_abi 3.7 1_cp37m conda-forge pyyaml 5.4.1 pypi_0 pypi readline 8.1 h27cfd23_0 defaults scipy 1.6.3 pypi_0 pypi setuptools 52.0.0 py37h06a4308_0 defaults six 1.15.0 py37h06a4308_0 defaults sqlite 3.35.4 hdfb4753_0 defaults tensorboardx 2.2 pypi_0 pypi tk 8.6.10 hbc83047_0 defaults torch 1.3.0 pypi_0 pypi torchvision 0.9.1 py37_cu101 pytorch tqdm 4.60.0 pypi_0 pypi typing_extensions 3.7.4.3 pyha847dfd_0 defaults wheel 0.36.2 pyhd3eb1b0_0 defaults x264 1!157.20191217 h7b6447c_0 defaults xz 5.2.5 h7b6447c_0 defaults yacs 0.1.8 pypi_0 pypi zlib 1.2.11 h7b6447c_3 defaults zstd 1.4.9 haebb681_0 defaults

SinDongHwan commented 3 years ago

Hi, @wangjiye7.

I've faced same problem.

first, check a cuda version of build torch.

$ python -c 'from torch.utils.collect_env import main; main()'
Collecting environment information...
PyTorch version: 1.7.0+cu110
Is debug build: True
CUDA used to build PyTorch: 11.0 <---- it's important
ROCM used to build PyTorch: N/A

if version differs "nvcc --version" and "CUDA used to build PyTorch", you have to match cuda version.

you can find support cuda version of pytorch in https://pytorch.org/get-started/previous-versions/

After run "pip install -e .", you should run "python setup.py build develop" because of creating "_custom_cuda_ext.cpython-36m-x86_64-linux-gnu.so" file.

I've refered this https://github.com/MVIG-SJTU/AlphAction/issues/26#issuecomment-712533056

Good Luck.