安装非root的cuda10.1:(失败)
sh cuda_10.1.105_418.39_linux.run提示如下错误:
Log file not open. Segmentation fault (core dumped)可能是数组越界,按照网上的方法进行尝试解决:
#设置core大小为无限 ulimit -c unlimited #设置文件大小为无限 ulimit unlimited仍然提示一样的错误!
安装非root的cuda9.2(成功)
建立conda环境:pytorch-encoding_python3.6
安装pytorch 1.4.0 (成功)安装pytorch-encoding(失败 成功) 失败原因:CUDA_HOME 设置错误,重新编写.bashrc 之后成功编译! -- Building version 1.2.2b20200901 c++: ['/home/yuanquan/PyTorch-Encoding/encoding/lib/cpu/syncbn_cpu.cpp', '/home/yuanquan/PyTorch Encoding/encoding/lib/cpu/encoding_cpu.cpp', '/home/yuanquan/PyTorch-Encoding/encoding/lib/cpu/rectify_cpu.cpp', '/home/yuanquan/PyTorch-Encoding/encoding/lib/cpu/roi_align_cpu.cpp', '/home/yuanquan/PyTorch-Encoding/encoding/lib/cpu/nms_cpu.cpp', '/home/yuanquan/PyTorch-Encoding/encoding/lib/cpu/operator.cpp'] cuda: ['/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/operator.cpp', '/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/nms_kernel.cu', '/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/roi_align_kernel.cu', '/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/lib_ssd.cu', '/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/rectify_cuda.cu', '/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/encoding_kernel.cu', '/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/activation_kernel.cu', '/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/syncbn_kernel.cu'] running install running bdist_egg running egg_info writing torch_encoding.egg-info/PKG-INFO writing dependency_links to torch_encoding.egg-info/dependency_links.txt writing requirements to torch_encoding.egg-info/requires.txt writing top-level names to torch_encoding.egg-info/top_level.txt reading manifest file 'torch_encoding.egg-info/SOURCES.txt' writing manifest file 'torch_encoding.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py copying encoding/version.py -> build/lib.linux-x86_64-3.6/encoding running build_ext building 'encoding.gpu' extension gcc -pthread -B /home/yuanquan/anaconda3/envs/pytorch-encoding/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/yuanquan/PyTorch-Encoding/encoding/lib/cpu -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include/TH -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include/THC -I/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include/TH -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include/THC -I/home/yuanquan/cuda-9.2:/home/yuanquan/cuda-9.2:/usr/local/cuda-9.0:/usr/local/cuda-9.0:/usr/local/cuda-9.0/include -I/home/yuanquan/anaconda3/envs/pytorch-encoding/include/python3.6m -c /home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/operator.cpp -o build/temp.linux-x86_64-3.6/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/operator.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=gpu -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++ -- Building version 1.2.2b20200901 c++: ['/home/yuanquan/PyTorch-Encoding/encoding/lib/cpu/syncbn_cpu.cpp', '/home/yuanquan/PyTorch-Encoding/encoding/lib/cpu/encoding_cpu.cpp', '/home/yuanquan/PyTorch-Encoding/encoding/lib/cpu/rectify_cpu.cpp', '/home/yuanquan/PyTorch-Encoding/encoding/lib/cpu/roi_align_cpu.cpp', '/home/yuanquan/PyTorch-Encoding/encoding/lib/cpu/nms_cpu.cpp', '/home/yuanquan/PyTorch-Encoding/encoding/lib/cpu/operator.cpp'] cuda: ['/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/operator.cpp', '/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/nms_kernel.cu', '/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/roi_align_kernel.cu', '/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/lib_ssd.cu', '/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/rectify_cuda.cu', '/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/encoding_kernel.cu', '/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/activation_kernel.cu', '/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/syncbn_kernel.cu'] running install running bdist_egg running egg_info writing torch_encoding.egg-info/PKG-INFO writing dependency_links to torch_encoding.egg-info/dependency_links.txt writing requirements to torch_encoding.egg-info/requires.txt writing top-level names to torch_encoding.egg-info/top_level.txt reading manifest file 'torch_encoding.egg-info/SOURCES.txt' writing manifest file 'torch_encoding.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py copying encoding/version.py -> build/lib.linux-x86_64-3.6/encoding running build_ext building 'encoding.gpu' extension gcc -pthread -B /home/yuanquan/anaconda3/envs/pytorch-encoding/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/yuanquan/PyTorch-Encoding/encoding/lib/cpu -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include/TH -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include/THC -I/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include/TH -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include/THC -I/home/yuanquan/cuda-9.2:/home/yuanquan/cuda-9.2:/usr/local/cuda-9.0:/usr/local/cuda-9.0:/usr/local/cuda-9.0/include -I/home/yuanquan/anaconda3/envs/pytorch-encoding/include/python3.6m -c /home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/operator.cpp -o build/temp.linux-x86_64-3.6/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/operator.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=gpu -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++ /home/yuanquan/cuda-9.2:/home/yuanquan/cuda-9.2:/usr/local/cuda-9.0:/usr/local/cuda-9.0:/usr/local/cuda-9.0/bin/nvcc -DWITH_CUDA -I/home/yuanquan/PyTorch-Encoding/encoding/lib/cpu -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include/TH -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include/THC -I/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include/TH -I/home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/torch/include/THC -I/home/yuanquan/cuda-9.2:/home/yuanquan/cuda-9.2:/usr/local/cuda-9.0:/usr/local/cuda-9.0:/usr/local/cuda-9.0/include -I/home/yuanquan/anaconda3/envs/pytorch-encoding/include/python3.6m -c /home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/nms_kernel.cu -o build/temp.linux-x86_64-3.6/home/yuanquan/PyTorch-Encoding/encoding/lib/gpu/nms_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=gpu -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61 -std=c++11 unable to execute '/home/yuanquan/cuda-9.2:/home/yuanquan/cuda-9.2:/usr/local/cuda-9.0:/usr/local/cuda-9.0:/usr/local/cuda-9.0/bin/nvcc': No such file or directory error: command '/home/yuanquan/cuda-9.2:/home/yuanquan/cuda-9.2:/usr/local/cuda-9.0:/usr/local/cuda-9.0:/usr/local/cuda-9.0/bin/nvcc' failed with exit status 1 pytorch-encoding 存放地址: /home/yuanquan/anaconda3/envs/pytorch-encoding/lib/python3.6/site-packages/encoding/ 准备pcontext数据库出现问题: cannot import cpu cannot import gpu cpu.py: /home/qyuan/anaconda3/envs/pytorch_encoding_interpreter/lib/python3.6/site-packages/torch_encoding-1.2.2b20200831-py3.6-linux-x86_64.egg/encoding/cpu.py def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, importlib.util __file__ = pkg_resources.resource_filename(__name__, 'cpu.cpython-36m-x86_64-linux-gnu.so') __loader__ = None; del __bootstrap__, __loader__ spec = importlib.util.spec_from_file_location(__name__,__file__) mod = importlib.util.module_from_spec(spec) spec.loader.exec_module(mod) __bootstrap__() gpu.py def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, importlib.util __file__ = pkg_resources.resource_filename(__name__, 'gpu.cpython-36m-x86_64-linux-gnu.so') __loader__ = None; del __bootstrap__, __loader__ spec = importlib.util.spec_from_file_location(__name__,__file__) mod = importlib.util.module_from_spec(spec) spec.loader.exec_module(mod) __bootstrap__() 使用源安装之后,使用pip install再安装一次,执行import encoding操作,初夏如下错误: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/yuanquan/anaconda3/envs/torch-encoding/lib/python3.6/site-packages/torch_encoding-1.2.2b20200902-py3.6-linux-x86_64.egg/encoding/__init__.py", line 13, in <module> from . import nn, functions, parallel, utils, models, datasets, transforms File "/home/yuanquan/anaconda3/envs/torch-encoding/lib/python3.6/site-packages/torch_encoding-1.2.2b20200902-py3.6-linux-x86_64.egg/encoding/datasets/__init__.py", line 7, in <module> from .pascal_aug import VOCAugSegmentation File "/home/yuanquan/anaconda3/envs/torch-encoding/lib/python3.6/site-packages/torch_encoding-1.2.2b20200902-py3.6-linux-x86_64.egg/encoding/datasets/pascal_aug.py", line 3, in <module> import scipy.io File "/home/yuanquan/anaconda3/envs/torch-encoding/lib/python3.6/site-packages/scipy/__init__.py", line 155, in <module> from . import fft File "/home/yuanquan/anaconda3/envs/torch-encoding/lib/python3.6/site-packages/scipy/fft/__init__.py", line 79, in <module> from ._helper import next_fast_len File "/home/yuanquan/anaconda3/envs/torch-encoding/lib/python3.6/site-packages/scipy/fft/_helper.py", line 3, in <module> from ._pocketfft import helper as _helper File "/home/yuanquan/anaconda3/envs/torch-encoding/lib/python3.6/site-packages/scipy/fft/_pocketfft/__init__.py", line 3, in <module> from .basic import * File "/home/yuanquan/anaconda3/envs/torch-encoding/lib/python3.6/site-packages/scipy/fft/_pocketfft/basic.py", line 6, in <module> from . import pypocketfft as pfft ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /home/yuanquan/anaconda3/envs/torch-encoding/lib/python3.6/site-packages/scipy/fft/_pocketfft/pypocketfft.cpython-36m-x86_64-linux-gnu.so)删除环境 重新安装!(问题可能在于python3.6,使用python3.7试试!)
创建py3.7环境pytorch-encoding
pytorch1.4.0 cuda9.2
安装pytorch-encoding from source
问题:安装包名为encoding,pytorch-encoding文件夹下也有同名文件夹,导致import时到该文件夹下寻找不到就报错,而不去环境中的包中去找!
问题:使用pip install torch-encoding 安装成功之后,import encoding之后会死机,重新安装环境!
疑问:环境中已经安装名为A的包,B.py目录下也有一个名为A的文件夹,当B.py中执行:
import A解释器会到A文件夹中会搜索而不是A包中!很疑惑为什么???