CondLaneNet复现

bash 复制代码
lsb_release -a

Distributor ID: Ubuntu

Description: Ubuntu 18.04.4 LTS

Release: 18.04

Codename: bionic

安装cuda

不需要安装driver,如果勾选着可能会安装失败,取消driver的选项即可。
https://developer.nvidia.com/cuda-toolkit-archive

bash 复制代码
sh cuda_10.2.89_440.33.01_linux.run
bash 复制代码
vim ~/.bashrc 
bash 复制代码
export PATH=/usr/local/cuda-10.2/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64:$LD_LIBRARY_PATH
bash 复制代码
source ~/.bashrc
nvcc -V

nvcc: NVIDIA (R) Cuda compiler driver

Copyright (c) 2005-2019 NVIDIA Corporation

Built on Wed_Oct_23_19:24:38_PDT_2019

Cuda compilation tools, release 10.2, V10.2.89

安装annoconda

下载之前版本的,查找网站https://repo.anaconda.com/archive/

annoconda自带python版本,参考https://github.com/koverholt/anaconda-version-map

bash 复制代码
sh Anaconda3-2020.02-Linux-x86_64.sh

安装完成后,重新打开终端就可以使用了。通过conda create创建新的环境。

安装 pytorch

bash 复制代码
pip3 install torch==1.8.1+cu102 torchvision==0.9.1+cu102 torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html

可以测试一下

python 复制代码
import torch
 
print(torch.__version__)
print(torch.cuda.is_available())
 
x = torch.randn(1)
if torch.cuda.is_available():
    device = torch.device("cuda")
    y = torch.ones_like(x, device=device)
    x = x.to(device)
    z = x + y
    print(z)
    print(z.to("cpu", torch.double))

安装opencv

bash 复制代码
apt-get update
apt-get install -y libsm6 libxext6 libxrender-dev
pip install opencv-python==4.1.1.26

报错: ImportError: libGL.so.1: cannot open shared object file: No such file or directory

bash 复制代码
pip install opencv-python-headless==3.4.11.43

安装mmcv

原始代码中用的mmcv和mmdet还是非正式版本,现在都找不到哪里可以下载,放弃了,使用新版本,还修改了原来代码中对mmdet的某些引用,替换成了os库中的。

选择mmdet之前版本的说明文档,可以看到mmdet和mmcv的版本兼容对应。
https://mmdetection.readthedocs.io/zh-cn/v2.24.0/get_started.html

从官方的网站上,下载之前的mmcv版本,下载whl文件后自己安装比较快。https://download.openmmlab.com/mmcv/dist/cu102/torch1.8.0/index.html

bash 复制代码
pip install mmcv_full-1.3.0-cp37-cp37m-manylinux1_x86_64.whl

安装mmdet(不需要,但我瞎安了好久)

这个真的巨麻烦,各种版本的不匹配,代码的不可用...

但是原本代码里是自带mmdet 2.0.0的,版本很低,和mmcv不匹配..反正都是坑。

报错:note: This error originates from a subprocess, and is likely not a problem with pip.

error: legacy-install-failure

安装cython的低版本,之后正常安装。

bash 复制代码
pip3 install cython==0.29.33 -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
pip install mmdet==2.11.0

运行

bash 复制代码
git clone https://github.com/aliyun/conditional-lane-detection.git
cd conditional-lane-detection
bash 复制代码
pip install -r requirements/build.txt
python setup.py develop

albumentations==0.4.6 竟然需要opencv-python==4.1.1以上,我真的吐血。所以前面安装opencv的时候装的4.1.1.26。

mmcv==0.5.6我不知道怎装,之前版本只找到了arm架构的安装包,没有x86的,很吐血,我装的是1.1.3,之前描述了。所以会遇到问题

报错:KeyError: 'ConvWS is already registered in conv layer'

修改下文件就行了

conditional-lane-detection/mmdet/ops/conv_ws.py"

python 复制代码
@CONV_LAYERS.register_module('ConvWS')
修改为:
@CONV_LAYERS.register_module(name='ConvWS', force=True)

创建tusimple的label

bash 复制代码
python generate_seg_tusimple.py --root /opt/data/private/msl/Testmodel/tusimple

运行测试代码

bash 复制代码
python tools/condlanenet/tusimple/test_tusimple.py /opt/data/private/shaohua/TestModel/conditional-lane-detection/configs/condlanenet/tusimple/tusimple_small_test.py  tusimple_small.pth

测试tusimple_large的时候会报错,需要修改test文件中的内容。参考
TuSimple Test: The model and loaded state dict do not match exactly. · Issue #16 · aliyun/conditional-lane-detection · GitHub

相关推荐
heimeiyingwang12 小时前
企业供应链 AI 优化:需求预测与智能调度
大数据·数据库·人工智能·机器学习
bst@微胖子13 小时前
PyTorch深度学习框架之基础实战二
人工智能·深度学习
狮子座明仔16 小时前
体验式强化学习:让模型学会“吃一堑长一智“
人工智能·深度学习·自然语言处理
癫狂的兔子17 小时前
【Python】【机器学习】支持向量积
python·机器学习
童园管理札记17 小时前
【记录模板】大班科学小游戏观察记录(盐主题:《会变魔术的盐》)
经验分享·深度学习·职场和发展·学习方法·微信公众平台
侧岭灵风18 小时前
人工智能各名词解释
人工智能·机器学习
癫狂的兔子19 小时前
【Python】【机器学习】贝叶斯算法
python·机器学习
CelestialYuxin19 小时前
A.R.I.S.系统:YOLOx在破碎电子废料分拣中的新探索
人工智能·深度学习·算法
Flying pigs~~20 小时前
机器学习之KNN算法
算法·机器学习·大模型·knn·k近邻算法·大数据处理
Asher阿舍技术站20 小时前
【AI基础学习系列】八、机器学习常见名词汇总
人工智能·学习·机器学习·常见名词