相关文章推荐
求醉的剪刀  ·  MD 组件之 ...·  1 年前    · 

cat /proc/version
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)

CUDA 版本

nvcc --version
Cuda compilation tools, release 10.2, V10.2.89
CUDA_HOME=/usr/local/cuda

CUDNN

下载linux版本,解压
~/software$ tar -zxvf cudnn-10.2-linux-x64-v8.0.4.30.tgz
所有的文件会解压到~/software/cuda
以下都在~/software目录下操作

添加路径,其中 /home/admin17/software/cuda/lib64 是我下载cudnn解压的路径

gedit  ~/.bashrc
export LD_LIBRARY_PATH=/home/admin17/software/cuda/lib64:$LD_LIBRARY_PATH
source  ~/.bashrc
cd ~/software
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64

有一些高版本的版本信息在cudnn_version.h 中,需要将cudnn_version.h 复制过去

sudo cp cuda/include/cudnn_version.h /usr/local/cuda/include
添加读写权限:

sudo chmod a+r /usr/local/cuda/include/cudnn.h
sudo chmod a+r /usr/local/cuda/lib64/libcudnn*
sudo chmod a+r /usr/local/cuda/include/cudnn_version.h

低版本查看版本的命令:
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
高版本查看版本的命令:
cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2
输出

UDNN_MAJOR -A 2
#define CUDNN_MAJOR 8
#define CUDNN_MINOR 0
#define CUDNN_PATCHLEVEL 4
#define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)
#endif /* CUDNN_VERSION_H */

说明版本 8.0.4

conda

conda -V
conda 4.5.11

Anaconda

You need install anaconda at first, then run below

conda create -n platform python=3.7.0
conda activate platform

PyTorch

pip install torch==1.6.0
pip install torchvision==0.7.0

MMdetection

git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
git checkout v2.8.0
pip install mmcv-full
pip install matplotlib==3.1.0
pip install -r requirements/build.txt
python setup.py develop

可能的错误:
gnutls_handshake() failed: The TLS connection was non-properly terminated.
网不好 重新 git clone https://github.com/open-mmlab/mmdetection.git

Pyinstaller

pip install pyinstaller

test_endecode

解压 /home/admin17/code/platform/test_endecode.zip
conda activate platform
cd ~/code/platform/test_endecode/
mkdir build
cmake …

报错
Could not find a package configuration file provided by “pybind11” with any
of the following names:

pybind11Config.cmake
pybind11-config.cmake

Add the installation prefix of “pybind11” to CMAKE_PREFIX_PATH or set
“pybind11_DIR” to a directory containing one of the above files. If
“pybind11” provides a separate development package or SDK, be sure it has
been installed.

查找Pyinstaller
pip show Pillow
Location: /home/admin17/anaconda3/envs/platform/lib/python3.7/site-packages

在Location 搜索pybind11Config.cmake 找到目录
/home/admin17/anaconda3/envs/platform/lib/python3.7/site-packages/pybind11/share/cmake/pybind11

在/home/admin17/code/platform/test_endecode/CMakeLists.txt中添加
set(pybind11_DIR /home/admin17/anaconda3/envs/platform/lib/python3.7/site-packages/pybind11/share/cmake/pybind11)

重新编译
conda activate platform
cd ~/code/platform/test_endecode/
mkdir build
cmake …
make
成功

gedit ~/.bashrc
在.bashrc中添加

export LD_LIBRARY_PATH=/home/admin17/code/platform/test_endecode/lib:$LD_LIBRARY_PATH

采用命令source ~/.bashrc激活

pytest-runner

pip install pytest-runner
pip install mmcv-full==1.2.6

sudo dpkg -i codemeter_7.0.3925.501_amd64.deb 不一定
/home/admin17/code/platform/utils/utils.py", line 11, in
import endecode
ModuleNotFoundError: No module named 'endecode’

我注释了endecode相关代码

查看版本ubuntucat /proc/versiongcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)CUDA 版本nvcc --versionCuda compilation tools, release 10.2, V10.2.89CUDA_HOME=/usr/local/cudaCUDNN下载linux版本,解压~/software$ tar -zxvf cudnn-10.2-linux-x64-v8.0.4.30.tgz所有的文件会 -- Python checking for Python version 3.5 or greater -- Python checking for Python version 3.5 or greater - found -- Python checking for Mako templates 0.4.2 or greater -- Python checking for Mako templates 0.4.2 or greater - "import mako windows10 无cuda 用c++调用pytorch模型官网上面有详细教程,也有很多博客,可以参考以下链接:pytorch怎么使用c++调用部署模型?_豆芽菜-CSDN博客_pytorch用c++ 以及:Pytorch的C++前端(libtorch)在Windows下的预测 - 知乎 在操作的过程中,主要遇到三个比较大的问题: 问题一:cmake编译时以及找不到torch和opencv相关的cmake文件(以下代码是复制的stac
Could not find a package configuration file provided by "pybind11" with any of the following names: pybind11Config.cmake pybind11-config.cmake not use pip to install pybind conda install pybind11
今天catkin build 整个工程,编译catkin_tools_prebuild时遇到失败的情况,如下: The catkin CMake module was not found, but it is required to build a linked workspace. To resolve this, please do one of the following, and ...
CMake Error at CMakeLists.txt:7 (find_package): By not providing "FindOpencv.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Opencv", but CMake did not find one. Could not fin
在ROS编译过程中经常会遇到找不到ROS包的情况,如下所示 CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package): Could not find a package configuration file provided by...     Could not find a package configuration file provided by       "gazebo_ros_control" with any of the following names:         gazebo_ros_controlConfig.cmake         gaz...
cmake时出现 -- Detected version of GNU GCC: 54 (504) -- Found ZLIB: /usr/lib/i386-linux-gnu/libz.so (found suitable version "1.2.8", minimum required is "1.2.3") -- Could NOT find TIFF (missing: TIFF_
1. 首先,你需要安装Anaconda或者Miniconda,这是一个Python的环境管理器,可以方便地安装和管理Python的依赖包。 2. 安装CUDA和cuDNN,这是深度学习框架需要的GPU加速库,可以大大提高训练速度。 3. 安装PyTorch,这是一个深度学习框架,mmdetection是基于PyTorch实现的。 4. 克隆mmdetection的代码库,可以使用git命令:git clone https://github.com/open-mmlab/mmdetection.git 5. 安装mmdetection的依赖包,可以使用conda命令:conda install pytorch torchvision -c pytorch 6. 编译mmdetection的C++扩展,可以使用以下命令: cd mmdetection pip install -r requirements/build.txt pip install "git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI" pip install -v -e . 7. 运行mmdetection的示例代码,可以使用以下命令: cd mmdetection python tools/train.py configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py 以上就是在Ubuntu安装mmdetection的步骤,希望对你有帮助。