Coder Social home page Coder Social logo

turoad / lanedet Goto Github PK

View Code? Open in Web Editor NEW
551.0 13.0 87.0 495 KB

An open source lane detection toolbox based on PyTorch, including SCNN, RESA, UFLD, LaneATT, CondLane, etc.

License: Apache License 2.0

Python 96.44% C++ 0.87% Cuda 2.43% Dockerfile 0.27%
lane-detection scnn resa ufld laneatt culane lane-line-detection deep-learning lane-detection-toolbox tusimple conditional-lane-detection

lanedet's Introduction

LaneDet

Introduction

LaneDet is an open source lane detection toolbox based on PyTorch that aims to pull together a wide variety of state-of-the-art lane detection models. Developers can reproduce these SOTA methods and build their own methods.

demo image

Table of Contents

Benchmark and model zoo

Supported backbones:

  • ResNet
  • ERFNet
  • VGG
  • MobileNet
  • [] DLA(coming soon)

Supported detectors:

Installation

Clone this repository

git clone https://github.com/turoad/lanedet.git

We call this directory as $LANEDET_ROOT

Create a conda virtual environment and activate it (conda is optional)

conda create -n lanedet python=3.8 -y
conda activate lanedet

Install dependencies

# Install pytorch firstly, the cudatoolkit version should be same in your system.

conda install pytorch==1.8.0 torchvision==0.9.0 cudatoolkit=10.1 -c pytorch

# Or you can install via pip
pip install torch==1.8.0 torchvision==0.9.0

# Install python packages
python setup.py build develop

Data preparation

CULane

Download CULane. Then extract them to $CULANEROOT. Create link to data directory.

cd $LANEDET_ROOT
mkdir -p data
ln -s $CULANEROOT data/CULane

For CULane, you should have structure like this:

$CULANEROOT/driver_xx_xxframe    # data folders x6
$CULANEROOT/laneseg_label_w16    # lane segmentation labels
$CULANEROOT/list                 # data lists

Tusimple

Download Tusimple. Then extract them to $TUSIMPLEROOT. Create link to data directory.

cd $LANEDET_ROOT
mkdir -p data
ln -s $TUSIMPLEROOT data/tusimple

For Tusimple, you should have structure like this:

$TUSIMPLEROOT/clips # data folders
$TUSIMPLEROOT/lable_data_xxxx.json # label json file x4
$TUSIMPLEROOT/test_tasks_0627.json # test tasks json file
$TUSIMPLEROOT/test_label.json # test label json file

For Tusimple, the segmentation annotation is not provided, hence we need to generate segmentation from the json annotation.

python tools/generate_seg_tusimple.py --root $TUSIMPLEROOT
# this will generate seg_label directory

Getting Started

Training

For training, run

python main.py [configs/path_to_your_config] --gpus [gpu_ids]

For example, run

python main.py configs/resa/resa50_culane.py --gpus 0

Testing

For testing, run

python main.py [configs/path_to_your_config] --validate --load_from [path_to_your_model] [gpu_num]

For example, run

python main.py configs/resa/resa50_culane.py --validate --load_from culane_resnet50.pth --gpus 0

Currently, this code can output the visualization result when testing, just add --view. We will get the visualization result in work_dirs/xxx/xxx/visualization.

For example, run

python main.py configs/resa/resa50_culane.py --validate --load_from culane_resnet50.pth --gpus 0 --view

Inference

See tools/detect.py for detailed information.

python tools/detect.py --help

usage: detect.py [-h] [--img IMG] [--show] [--savedir SAVEDIR]
                 [--load_from LOAD_FROM]
                 config

positional arguments:
  config                The path of config file

optional arguments:
  -h, --help            show this help message and exit
  --img IMG             The path of the img (img file or img_folder), for
                        example: data/*.png
  --show                Whether to show the image
  --savedir SAVEDIR     The root of save directory
  --load_from LOAD_FROM
                        The path of model

To run inference on example images in ./images and save the visualization images in vis folder:

python tools/detect.py configs/resa/resa34_culane.py --img images\
          --load_from resa_r34_culane.pth --savedir ./vis

Contributing

We appreciate all contributions to improve LaneDet. Any pull requests or issues are welcomed.

Licenses

This project is released under the Apache 2.0 license.

Acknowledgement

lanedet's People

Contributors

turoad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lanedet's Issues

Input size

The model input for lane_att with resnet 18 culane as backbone is 640x360 can i change it different input size?

RuntimeError: The detected CUDA version (10.1) mismatches the version that was used to compile PyTorch (11.3). Please make sure to use the same CUDA versions.

Hello, thank you for this code. I followed the directions carefully, but I can't get it to work.

When I run:

python setup.py build develop

I get:

RuntimeError:
The detected CUDA version (10.1) mismatches the version that was used to compile
PyTorch (11.3). Please make sure to use the same CUDA versions.

I have tried installing older (cuda 10.1-era) pytorch and torchvision, but that did nothing.

conda remove pytorch torchvision cudatoolkit
conda install pytorch==1.6.0 torchvision==0.7.0 cudatoolkit=10.1.168 -c pytorch

Do I have to downgrade CUDA in my whole computer? Is there no way to make it work inside conda?

Hope to hear from you.
Thank you

Issue when creating docker

in row no 38 of tools/detect.py
data = self.net.module.get_lanes(data)
which of function get_lanes will be called?
I am getting empty list when i created through docker

KeyError: 'img_metas'

Dear author,

I'm quiet new to the framework and tried to adapt some of the code for my own dataset.
After writing the dataset.py and the config based on the resnet50_culane.py i get this error when i start the training:

File "/projekte/lanedet/lanedet/lanedet/models/heads/condlane.py", line 867, in forward_train
print(batch['img_metas'])
KeyError: 'img_metas'

I understood that the data['img_metas'] is created in the preprocessing while executing collect_lane.
Isn't this information just overwritten in the ToTensorprocess:

def call(self, sample):
data = {}
if len(sample['img'].shape) < 3:
sample['img'] = np.expand_dims(sample['img'], -1)
for key in self.keys:
data[key] = to_tensor(sample[key])
data['img'] = data['img'].permute(2, 0, 1)
return data

How does the data['img_metas']-information preserve in the execution of the normal resnet50_culane.py?

@edit i tried the esnet50_culane.py with normal culane_dataset. Doesnt work for it either.

在windows下面运行setup.py报错

PS C:\Users\MINHOO\Desktop\lanedet-main> python setup.py build develop
C:\Users\MINHOO\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should
be satisfied by a PEP 517 installer.
warnings.warn(
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\lanedet
copying lanedet_init_.py -> build\lib.win-amd64-3.8\lanedet
creating build\lib.win-amd64-3.8\lanedet\datasets
copying lanedet\datasets\base_dataset.py -> build\lib.win-amd64-3.8\lanedet\datasets
copying lanedet\datasets\culane.py -> build\lib.win-amd64-3.8\lanedet\datasets
copying lanedet\datasets\registry.py -> build\lib.win-amd64-3.8\lanedet\datasets
copying lanedet\datasets\tusimple.py -> build\lib.win-amd64-3.8\lanedet\datasets
copying lanedet\datasets_init_.py -> build\lib.win-amd64-3.8\lanedet\datasets
creating build\lib.win-amd64-3.8\lanedet\engine
copying lanedet\engine\optimizer.py -> build\lib.win-amd64-3.8\lanedet\engine
copying lanedet\engine\registry.py -> build\lib.win-amd64-3.8\lanedet\engine
copying lanedet\engine\runner.py -> build\lib.win-amd64-3.8\lanedet\engine
copying lanedet\engine\scheduler.py -> build\lib.win-amd64-3.8\lanedet\engine
copying lanedet\engine_init_.py -> build\lib.win-amd64-3.8\lanedet\engine
creating build\lib.win-amd64-3.8\lanedet\models
copying lanedet\models\registry.py -> build\lib.win-amd64-3.8\lanedet\models
copying lanedet\models_init_.py -> build\lib.win-amd64-3.8\lanedet\models
creating build\lib.win-amd64-3.8\lanedet\ops
copying lanedet\ops\nms.py -> build\lib.win-amd64-3.8\lanedet\ops
copying lanedet\ops_init_.py -> build\lib.win-amd64-3.8\lanedet\ops
creating build\lib.win-amd64-3.8\lanedet\utils
copying lanedet\utils\config.py -> build\lib.win-amd64-3.8\lanedet\utils
copying lanedet\utils\culane_metric.py -> build\lib.win-amd64-3.8\lanedet\utils
copying lanedet\utils\logger.py -> build\lib.win-amd64-3.8\lanedet\utils
copying lanedet\utils\net_utils.py -> build\lib.win-amd64-3.8\lanedet\utils
copying lanedet\utils\recorder.py -> build\lib.win-amd64-3.8\lanedet\utils
copying lanedet\utils\registry.py -> build\lib.win-amd64-3.8\lanedet\utils
copying lanedet\utils\tusimple_metric.py -> build\lib.win-amd64-3.8\lanedet\utils
copying lanedet\utils\visualization.py -> build\lib.win-amd64-3.8\lanedet\utils
copying lanedet\utils_init_.py -> build\lib.win-amd64-3.8\lanedet\utils
creating build\lib.win-amd64-3.8\lanedet\datasets\process
copying lanedet\datasets\process\alaug.py -> build\lib.win-amd64-3.8\lanedet\datasets\process
copying lanedet\datasets\process\collect_lane.py -> build\lib.win-amd64-3.8\lanedet\datasets\process
copying lanedet\datasets\process\generate_lane_cls.py -> build\lib.win-amd64-3.8\lanedet\datasets\process
copying lanedet\datasets\process\generate_lane_line.py -> build\lib.win-amd64-3.8\lanedet\datasets\process
copying lanedet\datasets\process\process.py -> build\lib.win-amd64-3.8\lanedet\datasets\process
copying lanedet\datasets\process\transforms.py -> build\lib.win-amd64-3.8\lanedet\datasets\process
copying lanedet\datasets\process_init_.py -> build\lib.win-amd64-3.8\lanedet\datasets\process
creating build\lib.win-amd64-3.8\lanedet\models\aggregators
copying lanedet\models\aggregators\aspp.py -> build\lib.win-amd64-3.8\lanedet\models\aggregators
copying lanedet\models\aggregators\resa.py -> build\lib.win-amd64-3.8\lanedet\models\aggregators
copying lanedet\models\aggregators\scnn.py -> build\lib.win-amd64-3.8\lanedet\models\aggregators
copying lanedet\models\aggregators\transformer.py -> build\lib.win-amd64-3.8\lanedet\models\aggregators
copying lanedet\models\aggregators_init_.py -> build\lib.win-amd64-3.8\lanedet\models\aggregators
creating build\lib.win-amd64-3.8\lanedet\models\backbones
copying lanedet\models\backbones\erfnet.py -> build\lib.win-amd64-3.8\lanedet\models\backbones
copying lanedet\models\backbones\mobilenet.py -> build\lib.win-amd64-3.8\lanedet\models\backbones
copying lanedet\models\backbones\resnet.py -> build\lib.win-amd64-3.8\lanedet\models\backbones
copying lanedet\models\backbones\vgg.py -> build\lib.win-amd64-3.8\lanedet\models\backbones
copying lanedet\models\backbones_init_.py -> build\lib.win-amd64-3.8\lanedet\models\backbones
creating build\lib.win-amd64-3.8\lanedet\models\heads
copying lanedet\models\heads\busd.py -> build\lib.win-amd64-3.8\lanedet\models\heads
copying lanedet\models\heads\condlane.py -> build\lib.win-amd64-3.8\lanedet\models\heads
copying lanedet\models\heads\exist_head.py -> build\lib.win-amd64-3.8\lanedet\models\heads
copying lanedet\models\heads\laneatt.py -> build\lib.win-amd64-3.8\lanedet\models\heads
copying lanedet\models\heads\lane_cls.py -> build\lib.win-amd64-3.8\lanedet\models\heads
copying lanedet\models\heads\lane_seg.py -> build\lib.win-amd64-3.8\lanedet\models\heads
copying lanedet\models\heads\plain_decoder.py -> build\lib.win-amd64-3.8\lanedet\models\heads
copying lanedet\models\heads_init_.py -> build\lib.win-amd64-3.8\lanedet\models\heads
creating build\lib.win-amd64-3.8\lanedet\models\necks
copying lanedet\models\necks\fpn.py -> build\lib.win-amd64-3.8\lanedet\models\necks
copying lanedet\models\necks_init_.py -> build\lib.win-amd64-3.8\lanedet\models\necks
creating build\lib.win-amd64-3.8\lanedet\models\nets
copying lanedet\models\nets\detector.py -> build\lib.win-amd64-3.8\lanedet\models\nets
copying lanedet\models\nets_init_.py -> build\lib.win-amd64-3.8\lanedet\models\nets
running egg_info
creating lanedet.egg-info
writing lanedet.egg-info\PKG-INFO
writing dependency_links to lanedet.egg-info\dependency_links.txt
warnings.warn(msg.format('we could not find ninja.'))
reading manifest file 'lanedet.egg-info\SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'lanedet.egg-info\SOURCES.txt'
running build_ext
C:\Users\MINHOO\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\utils\cpp_extension.py:304: UserWarning: Error checking compiler version for cl: 'utf-8' codec can't decode
byte 0xd3 in position 0: invalid continuation byte
warnings.warn(f'Error checking compiler version for {compiler}: {error}')
building 'lanedet.ops.nms_impl' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

curvature estimation

Hello, I would like to know if there is any way to get real-time lane detection and curvature detection using deep learning. I have seen traditional computer vision algorithms but I am looking for a Deep Learning model that could help me out with this. Any suggestions will be very helpful. Thanks in advance.

inference does not seem to work correctly (input image not scaled correctly?)

Hi there, thank you for this very helpful resource. However I was wondering if there is something wrong with some of the inference code, in particular the given code in the README for RESA resnet34 trained on CUlanes. I fed the following image in:
image

And received the following output:

image

I was wondering why this is and if there is anything I am doing wrong or if this is a problem with the uploaded models themselves. If it is helpful please find attached the colab notebook I was using: https://colab.research.google.com/drive/1WI0T-s0dRvewnkm_qrwvM3NOjNiMEXXv?usp=sharing

Thank you in advance.

ValueError: bbox_params must be specified for bbox transformations

when run 'python train.py configs/condlane/resnet101_culane.py --gpus0' ,it shows the error,and info shows location as follows:
lanedet-condlane/lanedet/datasets/process/alaug.py", line 160, in call
bbox_labels=bbox_labels)

i check this function, and bboxes=None,bbox_labels=None
image

How can i solve this issue,thx!

--view for culane dataset doesnt work

Hi, when i add --view for culane dataset it doesnt work with the error
Traceback (most recent call last):
File "main.py", line 65, in
main()
File "main.py", line 33, in main
runner.validate()
File "/home/grgur/lanedet/lanedet/engine/runner.py", line 116, in validate
self.val_loader.dataset.view(output, data['meta'])
KeyError: 'meta'

For the TuSimple dataset it added to the vizualization file with no problem, but for culane somehow it doesnt work.
Please help.

关于一个奇怪的 UserWarning

您好!
无论是我运行train/val/detect, 都会报这样一个错:UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at /pytorch/c10/core/TensorImpl.h:1156.)
return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)

顺便问一下,用你另一个代码仓(resa)训练出来的pth文件,配合这个lanedet是不是无法使用,好像lanedet的resa结构把exist删掉了。

KeyError: 'meta'

Hello,

when run:
python main.py configs/scnn/resnet18_tusimple.py --validate --load_from scnn_r18_tusimple.pth --gpus 0 --view, the following error error occurred.

lanedet/engine/runner.py", line 116, in validate
self.val_loader.dataset.view(output, data['meta'])
KeyError: 'meta'

when not add --view,it's normal.

What is the problem and how to solve it?

Getting ther error -> KeyError: 'net' for net.load_state_dict(pretrained_model['net'], strict=True)

I'm working on Debian 10 (Buster). For this repo, I'm using the pre-trained model "resnet34-333f7ec4.pth".
The config file being used is "configs/resa/resa34_culane.py"
The complete traceback error is as follows:

Traceback (most recent call last):
  File "tools/detect.py", line 87, in <module>
    process(args)
  File "tools/detect.py", line 73, in process
    detect = Detect(cfg)
  File "tools/detect.py", line 26, in __init__
    load_network(self.net, self.cfg.load_from)
  File "/home/ameya/K/TF/kspace/Auto_Bus/Traffic_Lane_Detection/Traffic_Lane_Detection_3/lanedet/lanedet/utils/net_utils.py", line 48, in load_network
    net.load_state_dict(pretrained_model['net'], strict=True)
KeyError: 'net'

When I print the network like print(self.net) in in detect.py, the result is:

DataParallel(
  (module): Detector(
    (backbone): ResNetWrapper(
      (model): ResNet(
        (conv1): Conv2d(3, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False)
        (bn1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(inplace=True)
        (maxpool): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)
        (layer1): Sequential(
          (0): BasicBlock(
            (conv1): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
            (bn1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
            (relu): ReLU(inplace=True)
            (conv2): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
            (bn2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          )
          (1): BasicBlock(
            (conv1): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
            (bn1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
            (relu): ReLU(inplace=True)
            (conv2): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
            (bn2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          )
          (2): BasicBlock(
            (conv1): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
            (bn1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
            (relu): ReLU(inplace=True)
            (conv2): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
            (bn2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          )
        )
        (layer2): Sequential(
          (0): BasicBlock(
            (conv1): Conv2d(64, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
            (bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
            (relu): ReLU(inplace=True)
            (conv2): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
            (bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
            (downsample): Sequential(
              (0): Conv2d(64, 128, kernel_size=(1, 1), stride=(2, 2), bias=False)
              (1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
            )
          )
          (1): BasicBlock(
            (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
            (bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
            (relu): ReLU(inplace=True)
            (conv2): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
            (bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          )
          (2): BasicBlock(
            (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
            (bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
            (relu): ReLU(inplace=True)
            (conv2): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
            (bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          )
          (3): BasicBlock(
            (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
            (bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
            (relu): ReLU(inplace=True)
            (conv2): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
            (bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          )
        )
        (layer3): Sequential(
          (0): BasicBlock(
            (conv1): Conv2d(128, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
            (bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
            (relu): ReLU(inplace=True)
            (conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
            (bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
            (downsample): Sequential(
              (0): Conv2d(128, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
              (1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
            )
          )
          (1): BasicBlock(
            (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(2, 2), dilation=(2, 2), bias=False)
            (bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
            (relu): ReLU(inplace=True)
            (conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(2, 2), dilation=(2, 2), bias=False)
            (bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          )
          (2): BasicBlock(
            (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(2, 2), dilation=(2, 2), bias=False)
            (bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
            (relu): ReLU(inplace=True)
            (conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(2, 2), dilation=(2, 2), bias=False)
            (bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          )
          (3): BasicBlock(
            (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(2, 2), dilation=(2, 2), bias=False)
            (bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
            (relu): ReLU(inplace=True)
            (conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(2, 2), dilation=(2, 2), bias=False)
            (bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          )
          (4): BasicBlock(
            (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(2, 2), dilation=(2, 2), bias=False)
            (bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
            (relu): ReLU(inplace=True)
            (conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(2, 2), dilation=(2, 2), bias=False)
            (bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          )
          (5): BasicBlock(
            (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(2, 2), dilation=(2, 2), bias=False)
            (bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
            (relu): ReLU(inplace=True)
            (conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(2, 2), dilation=(2, 2), bias=False)
            (bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          )
        )
      )
      (out): Conv2d(256, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
    )
    (aggregator): RESA(
      (conv_d0): Conv2d(128, 128, kernel_size=(1, 9), stride=(1, 1), padding=(0, 4), bias=False)
      (conv_u0): Conv2d(128, 128, kernel_size=(1, 9), stride=(1, 1), padding=(0, 4), bias=False)
      (conv_r0): Conv2d(128, 128, kernel_size=(9, 1), stride=(1, 1), padding=(4, 0), bias=False)
      (conv_l0): Conv2d(128, 128, kernel_size=(9, 1), stride=(1, 1), padding=(4, 0), bias=False)
      (conv_d1): Conv2d(128, 128, kernel_size=(1, 9), stride=(1, 1), padding=(0, 4), bias=False)
      (conv_u1): Conv2d(128, 128, kernel_size=(1, 9), stride=(1, 1), padding=(0, 4), bias=False)
      (conv_r1): Conv2d(128, 128, kernel_size=(9, 1), stride=(1, 1), padding=(4, 0), bias=False)
      (conv_l1): Conv2d(128, 128, kernel_size=(9, 1), stride=(1, 1), padding=(4, 0), bias=False)
      (conv_d2): Conv2d(128, 128, kernel_size=(1, 9), stride=(1, 1), padding=(0, 4), bias=False)
      (conv_u2): Conv2d(128, 128, kernel_size=(1, 9), stride=(1, 1), padding=(0, 4), bias=False)
      (conv_r2): Conv2d(128, 128, kernel_size=(9, 1), stride=(1, 1), padding=(4, 0), bias=False)
      (conv_l2): Conv2d(128, 128, kernel_size=(9, 1), stride=(1, 1), padding=(4, 0), bias=False)
      (conv_d3): Conv2d(128, 128, kernel_size=(1, 9), stride=(1, 1), padding=(0, 4), bias=False)
      (conv_u3): Conv2d(128, 128, kernel_size=(1, 9), stride=(1, 1), padding=(0, 4), bias=False)
      (conv_r3): Conv2d(128, 128, kernel_size=(9, 1), stride=(1, 1), padding=(4, 0), bias=False)
      (conv_l3): Conv2d(128, 128, kernel_size=(9, 1), stride=(1, 1), padding=(4, 0), bias=False)
    )
    (heads): LaneSeg(
      (decoder): PlainDecoder(
        (dropout): Dropout2d(p=0.1, inplace=False)
        (conv8): Conv2d(128, 5, kernel_size=(1, 1), stride=(1, 1))
      )
      (exist): ExistHead(
        (dropout): Dropout2d(p=0.1, inplace=False)
        (conv8): Conv2d(128, 5, kernel_size=(1, 1), stride=(1, 1))
        (fc9): Linear(in_features=4500, out_features=128, bias=True)
        (fc10): Linear(in_features=128, out_features=4, bias=True)
      )
    )
  )
)

Can anyone please tell me what I might be doing wrong?

RuntimeError: Error(s) in loading state_dict for DataParallel

Hi, I run RESA model inference with
python tools/detect.py configs/resa/resa34_tusimple.py --img 1.png --load_from weight/tusimple_resa34.pth --savedir ./vis
tusimple_resa34.pth download from the 'https://github.com/ZJULearning/resa'
but got
net.load_state_dict(pretrained_model['net'], strict=True)
File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1045, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for DataParallel:
Missing key(s) in state_dict: "module.aggregator.conv_d0.weight", ..........
Any advise, very thanks

OSError: Could not find lib geos_c or load any of its variants ['libgeos_c.so.1', 'libgeos_c.so'].

Hi,

I'm trying to run inference on Jetson TX2 with this command " python3 tools/detect.py configs/resa/resa34_culane.py --img images/ --load_from resa_r34_culane.pth --savedir ./vis " and i'm getting this error, Can anyone tell me what's the problem please !

Traceback (most recent call last):
File "tools/detect.py", line 8, in
from lanedet.datasets.process import Process
File "/home/hellojetsontx2/lanedet/lanedet/datasets/init.py", line 3, in
from .tusimple import TuSimple
File "/home/hellojetsontx2/lanedet/lanedet/datasets/tusimple.py", line 7, in
from .base_dataset import BaseDataset
File "/home/hellojetsontx2/lanedet/lanedet/datasets/base_dataset.py", line 10, in
from .process import Process
File "/home/hellojetsontx2/lanedet/lanedet/datasets/process/init.py", line 7, in
from .collect_lane import CollectLane
File "/home/hellojetsontx2/lanedet/lanedet/datasets/process/collect_lane.py", line 9, in
from shapely.geometry import Polygon, Point, LineString
File "/home/hellojetsontx2/.local/lib/python3.6/site-packages/shapely/geometry/init.py", line 4, in
from .base import CAP_STYLE, JOIN_STYLE
File "/home/hellojetsontx2/.local/lib/python3.6/site-packages/shapely/geometry/base.py", line 20, in
from shapely.coords import CoordinateSequence
File "/home/hellojetsontx2/.local/lib/python3.6/site-packages/shapely/coords.py", line 10, in
from shapely.geos import lgeos
File "/home/hellojetsontx2/.local/lib/python3.6/site-packages/shapely/geos.py", line 99, in
_lgeos = load_dll('geos_c', fallbacks=alt_paths)
File "/home/hellojetsontx2/.local/lib/python3.6/site-packages/shapely/geos.py", line 56, in load_dll
libname, fallbacks or []))
OSError: Could not find lib geos_c or load any of its variants ['libgeos_c.so.1', 'libgeos_c.so'].

lanedet-main/configs/condlane/resnet50_culane.py

when i use the config "lanedet-main/configs/condlane/resnet50_culane.py",but got
Traceback (most recent call last):
File "main.py", line 65, in
main()
File "main.py", line 35, in main
runner.train()
File "/home/data6/fmsfms/lanedet-main/lanedet/engine/runner.py", line 94, in train
self.train_epoch(epoch, train_loader)
File "/home/data6/fmsfms/lanedet-main/lanedet/engine/runner.py", line 67, in train_epoch
output = self.net(data)
File "/home/data6/fms/envs/laneatt/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/data6/fms/envs/laneatt/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 155, in forward
outputs = self.parallel_apply(replicas, inputs, kwargs)
File "/home/data6/fms/envs/laneatt/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 165, in parallel_apply
return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)])
File "/home/data6/fms/envs/laneatt/lib/python3.8/site-packages/torch/nn/parallel/parallel_apply.py", line 85, in parallel_apply
output.reraise()
File "/home/data6/fms/envs/laneatt/lib/python3.8/site-packages/torch/_utils.py", line 395, in reraise
raise self.exc_type(msg)
RuntimeError: Caught RuntimeError in replica 0 on device 0.
Original Traceback (most recent call last):
File "/home/data6/fms/envs/laneatt/lib/python3.8/site-packages/torch/nn/parallel/parallel_apply.py", line 60, in _worker
output = module(*input, **kwargs)
File "/home/data6/fms/envs/laneatt/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/data6/fmsfms/lanedet-main/lanedet/models/nets/detector.py", line 26, in forward
fea[-1] = self.aggregator(fea[-1])
File "/home/data6/fms/envs/laneatt/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/data6/fmsfms/lanedet-main/lanedet/models/aggregators/transformer.py", line 152, in forward
src = layer(src, pos.to(src.device))
File "/home/data6/fms/envs/laneatt/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/data6/fmsfms/lanedet-main/lanedet/models/aggregators/transformer.py", line 106, in forward
x += pos
RuntimeError: The size of tensor a (2) must match the size of tensor b (8) at non-singleton dimension 0

Can't convert the model to onnx

`sample_input = torch.rand((32, 3, 3, 3))

torch.onnx.export(
net1.module, # PyTorch Model
sample_input, # Input tensor
'/content/drive/MyDrive/MobileNetV2-model-onnx.onnx', # Output file (eg. 'output_model.onnx')
opset_version = 12, # Operator support version
input_names = ['input'], # Input tensor name (arbitary)
output_names = ['output'] # Output tensor name (arbitary)
)`

Got this Error:

TypeError Traceback (most recent call last)
in ()
5 opset_version=12, # Operator support version
6 input_names=['input'], # Input tensor name (arbitary)
----> 7 output_names=['output'] # Output tensor name (arbitary)
8 )

 21     def forward(self, batch):
 22         output = {}

---> 23 fea = self.backbone(batch['img'])
24
25 if self.aggregator:

TypeError: new(): invalid data type 'str'

运行setup.py 报错

/home/ma-user/anaconda3/envs/lanedet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:66:23: error: could not convert ‘torch::kLeakyReLU’ from ‘const torch::enumtype::kLeakyReLU’ to ‘torch::nn::init::NonlinearityType {aka c10::variant<torch::enumtype::kLinear, torch::enumtype::kConv1D, torch::enumtype::kConv2D, torch::enumtype::kConv3D, torch::enumtype::kConvTranspose1D, torch::enumtype::kConvTranspose2D, torch::enumtype::kConvTranspose3D, torch::enumtype::kSigmoid, torch::enumtype::kTanh, torch::enumtype::kReLU, torch::enumtype::kLeakyReLU>}’
error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1

报错很长,截取了最后一点,看了看好像就我一个人遇到这个问题

python 3.6
cuda Version: 10.2
torch==1.6.0
torchvision==0.7.0

KeyError: 'img_metas'

Hello!
This commit d36ba73 can fix this issue.
the latest code has included the above submission. This prompt still appears when running culane

Traceback (most recent call last):
File "main.py", line 65, in
main()
File "main.py", line 35, in main
runner.train()
File "/data4/xuzheng/lanedet/lanedet/engine/runner.py", line 94, in train
self.train_epoch(epoch, train_loader)
File "/data4/xuzheng/lanedet/lanedet/engine/runner.py", line 67, in train_epoch
output = self.net(data)
File "/root/anaconda3/envs/test/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/root/anaconda3/envs/test/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 165, in forward
return self.module(*inputs[0], **kwargs[0])
File "/root/anaconda3/envs/test/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/data4/xuzheng/lanedet/lanedet/models/nets/detector.py", line 32, in forward
out = self.heads(fea, batch=batch)
File "/root/anaconda3/envs/test/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/data4/xuzheng/lanedet/lanedet/models/heads/condlane.py", line 1012, in forward
return self.forward_train(x_list, kwargs['batch'])
File "/data4/xuzheng/lanedet/lanedet/models/heads/condlane.py", line 868, in forward_train
img_metas = batch['img_metas']
KeyError: 'img_metas'

how to support distributed training ?

Do you support slurm's single-machine multi-card training on the cluster?
FileExistsError: [Errno 17] File exists: 'work_dirs/TuSimple/20210802_193905_lr_3e-02_b_8'

Error

if don't modify (from .nms import nms) from lanedet/ops/init.py to (from . import *) there will be an error. and if don't modify (from . import nms_impl) from lanedet/ops/nms.py to (from . import *) there will be an error.
And when run inference, there is no lanedet directory in the tools directory, resulting in module error from lanedet/tools/detect.py line 8~12. Is there any other way to remove the error?

Your Resnet wrapper feature size vs OG pytorch resnet feature size (Last layer)

Hey, I was looking into your implementation of the Resnet wrapper. Everything seems identical apart from the feature map sizes. I see that you have tried to upsample the feature maps size somehow by increasing the padding and dilation parameters, does that affect your training accuracy? It will save me a lot of training time as I have really limited resources.

Thanks in advance!

A consultation on the results

Dear Author:
Could you please tell me whether the results reported in the paper can be reproduced by your kind re-implementation? How much score do you get on CULane and Tusimple, respectively ? By the way, could you please tell me how many GPUs do you use to generate the results? And can I have you in my contact list? My qq account is 2667004002. Look forward to your reply...

ImportError: connot import name 'nms_impl' form partially initialized module 'lanedet.ops' (most likely due to a circular improt)o)

When I run: python tools/detect.py configs/resa/resa34_culane.py --img images --load_from resa_r34_culane.pth --savedir ./vis
Traceback (most recent call last):
File "D:/XXX/XXX/XXX/lanedet-main/tools/detect.py", line 8, in
from lanedet.datasets.process import Process
File "D:\XXX\XXX\XXX\lanedet-main\lanedet_init_.py", line 1, in
from .ops import *
File "D:\XXX\XXX\XXX\lanedet-main\lanedet\ops_init_.py", line 1, in
from .nms import nms
File "D:\XXX\XXX\XXX\lanedet-main\lanedet\ops\nms.py", line 29, in
from . import nms_impl
ImportError: cannot import name 'nms_impl' from partially initialized module 'lanedet.ops' (most likely due to a circular import) (D:\XXX\XXX\XXX\lanedet-main\lanedet\ops_init_.py)

About KeyError in the training of CondaLaneNet

Traceback (most recent call last):
File "/home/room/python_projects/lanedet-main/main.py", line 65, in
main()
File "/home/room/python_projects/lanedet-main/main.py", line 35, in main
runner.train()
File "/home/room/python_projects/lanedet-main/lanedet/engine/runner.py", line 94, in train
self.train_epoch(epoch, train_loader)
File "/home/room/python_projects/lanedet-main/lanedet/engine/runner.py", line 67, in train_epoch
output = self.net(data)
File "/home/room/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/room/anaconda3/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 165, in forward
return self.module(*inputs[0], **kwargs[0])
File "/home/room/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/room/python_projects/lanedet-main/lanedet/models/nets/detector.py", line 32, in forward
out = self.heads(fea, batch=batch)
File "/home/room/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/room/python_projects/lanedet-main/lanedet/models/heads/condlane.py", line 1011, in forward
return self.forward_train(x_list, kwargs['batch'])
File "/home/room/python_projects/lanedet-main/lanedet/models/heads/condlane.py", line 867, in forward_train
img_metas = batch['img_metas']
KeyError: 'img_metas'

How can I properly change the input image size on CondLane?

Currently I'm detecting lanes using tools/detect.py.

For Condlane inference, I changed this

batch_size=1 # from 8 (for condlane inference)

And tried these configs for FHD input image

img_height = 1080 # from 320
img_width = 1920 # from 800

ori_img_h = 1080 # from 590
ori_img_w = 1920 # from 1640

crop_bbox = [0,540,1920,1080] # from [0, 270, 1640, 590]

Changing img_scale = (800,320) results

The size of tensor a must match the size of tensor b at non-singleton dimension 3

How can I properly change the input image size (ex. FHD) on CondLane config file?

Output Format

Hello,
i want to extract the model and i want to get the output tensor format because of tracer can not infer dict type. How can i get the output this format? Thank you in advance for your reply

Issue in inference code tools/detect.py

Thanks for your opensource I am taking a lot of inspiration from your project to develop my solution. I was referring to your code for inference for TUsimple dataset. For the network, I am using ERFnet as a baseline. But somehow while using your inferencing code, at tools/detect.py.

def get_lanes(self, output):

def probmap2lane(self, probmaps, exists=None):
        lanes = []
        probmaps = probmaps[1:, ...]
        if exists is None:
            exists = [True for _ in probmaps]
        for probmap, exist in zip(probmaps, exists):
            if exist == 0:
                continue
            probmap = cv2.blur(probmap, (9, 9), borderType=cv2.BORDER_REPLICATE)
            cut_height = self.cfg.cut_height
            ori_h = self.cfg.ori_img_h - cut_height
            coord = []
            for y in self.sample_y:
                proj_y = round((y - cut_height) * self.cfg.img_height/ori_h)
                line = probmap[proj_y]
                if np.max(line) < self.thr:
                    continue
                value = np.argmax(line) ##### here np.argmax returns always 0.#####
                x = value*self.cfg.ori_img_w/self.cfg.img_width#-1.
                if x > 0:
                    coord.append([x, y])
            if len(coord) < 5:
                continue

            coord = np.array(coord)
            coord = np.flip(coord, axis=0)
            coord[:, 0] /= self.cfg.ori_img_w
            coord[:, 1] /= self.cfg.ori_img_h
            lanes.append(Lane(coord))
    
        return lanes

At the mentioned line the value always returns zero:: value = np.argmax(line) ---> 0
and hence the lane list is empty. I tried to infer the given model using the script, for example in the case of resnet18, TUSimple, and SCNN pipeline. the model returns an output of shape (1,7,368,640). It absolutely matches with my output shape. But it breaks at the same place which I mentioned. Any help would be highly appreciated.

无法运行

为什么运行python main.py configs/condlane/resnet101_culane.py --gpus 0 1后输出configs里的内容就卡住不动了 ?有谁知道吗

Inference code keyError

(lanedet) emredo@emreninbilgisayari:~/lanedet$ python tools/detect.py configs/laneatt/resnet18_tusimple.py --img yol1.jpg --load_from /home/emredo/lanedet/work_dirs/TuSimple/20210623_163540_lr_3e-04_b_8/ckpt/best.pth --savedir ./savedimages

pretrained model: https://download.pytorch.org/models/resnet18-5c106cde.pth
Traceback (most recent call last):
File "tools/detect.py", line 84, in
process(args)
File "tools/detect.py", line 73, in process
detect.run(p)
File "tools/detect.py", line 47, in run
data = self.preprocess(data)
File "tools/detect.py", line 29, in preprocess
data = self.processes(data)
File "/home/emredo/lanedet/lanedet/datasets/process/process.py", line 35, in call
data = t(data)
File "/home/emredo/lanedet/lanedet/datasets/process/generate_lane_line.py", line 127, in call
line_strings_org = self.lane_to_linestrings(sample['lanes'])
KeyError: 'lanes'

Hi, when I try to use detect.py it gives an error which was given above. Why am I getting this error?
Thank you for repo and everything.

Really bad inference results

The inference outputs from the model are really bad even for very easy images.

  1. Using Laneatt_Res18_Culane
    straight-lines2-laneatt-res18

  2. Using SCNN_Res50_Culane
    straight-lines2-scnn-res50

Any idea why this is happening? I've just done normal inference without any changes.

Add Dockerfile

Hi,
It would be really helpful if a Dockerfile was available.
Please consider.

Thanks.

run:python setup.py build develop,has error

when i run command:python setup.py build develop ,i got

No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.5'
E:\develop2\Anaconda3\envs\lanedet\lib\site-packages\setuptools\installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer
is deprecated. Requirements should be satisfied by a PEP 517 installer.
  warnings.warn(
running build
running build_py
running egg_info
writing lanedet.egg-info\PKG-INFO
writing dependency_links to lanedet.egg-info\dependency_links.txt
writing requirements to lanedet.egg-info\requires.txt
writing top-level names to lanedet.egg-info\top_level.txt
reading manifest file 'lanedet.egg-info\SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'lanedet.egg-info\SOURCES.txt'
creating build\lib.win-amd64-3.8\lanedet\ops\csrc
copying lanedet\ops\csrc\nms.cpp -> build\lib.win-amd64-3.8\lanedet\ops\csrc
copying lanedet\ops\csrc\nms_kernel.cu -> build\lib.win-amd64-3.8\lanedet\ops\csrc
running build_ext
E:\develop2\Anaconda3\envs\lanedet\lib\site-packages\torch\utils\cpp_extension.py:304: UserWarning: Error checking compiler version
for cl: [WinError 2] 系统找不到指定的文件。
  warnings.warn(f'Error checking compiler version for {compiler}: {error}')
building 'lanedet.ops.nms_impl' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com
/visual-cpp-build-tools/

I dont know what happened.
Need i install Microsoft Visual C++ 14.0 or greater ? Or had i do something wrong?

cannot import name 'nms_impl' from partially initialized module 'lanedet.ops'

when i run main.py
The following errors are reported:

Traceback (most recent call last):
File "C:/Users/MINHOO/Desktop/大三下比赛/lanedet-main/main.py", line 8, in
from lanedet.utils.config import Config
File "C:\Users\MINHOO\Desktop\大三下比赛\lanedet-main\lanedet_init_.py", line 1, in
from .ops import *
File "C:\Users\MINHOO\Desktop\大三下比赛\lanedet-main\lanedet\ops_init_.py", line 1, in
from .nms import nms
File "C:\Users\MINHOO\Desktop\大三下比赛\lanedet-main\lanedet\ops\nms.py", line 29, in
from . import nms_impl
ImportError: cannot import name 'nms_impl' from partially initialized module 'lanedet.ops' (most likely due to a circular import) (C:\Users\MINHOO\Desktop\大三下比赛\lanedet-main\lanedet\ops_init_.py)

Process finished with exit code 1

评价

你好 请问一下culane的测试只有一个总的评价指标吗,culane的测试没提供各个类别的评价是吗?

Error when training resnet18 culane

Hi, thanks for your useful work!!

I have modified your resnet50_culane.py file to resnet18_culane.py and changed backbone to resnet18.
Then I ran training and faced with the error.
Can you help me clarify it!!

File "/mnt/09a762a6-3f6e-469b-8d6d-e9fa625e24b9/USER/LuanDD/lanedet/lanedet/engine/runner.py", line 67, in train_epoch output = self.net(data) File "/mnt/09a762a6-3f6e-469b-8d6d-e9fa625e24b9/USER/LuanDD/pyenv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/mnt/09a762a6-3f6e-469b-8d6d-e9fa625e24b9/USER/LuanDD/pyenv/lib/python3.6/site-packages/mmcv/parallel/data_parallel.py", line 42, in forward return super().forward(*inputs, **kwargs) File "/mnt/09a762a6-3f6e-469b-8d6d-e9fa625e24b9/USER/LuanDD/pyenv/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 165, in forward return self.module(*inputs[0], **kwargs[0]) File "/mnt/09a762a6-3f6e-469b-8d6d-e9fa625e24b9/USER/LuanDD/pyenv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/mnt/09a762a6-3f6e-469b-8d6d-e9fa625e24b9/USER/LuanDD/lanedet/lanedet/models/nets/detector.py", line 26, in forward fea[-1] = self.aggregator(fea[-1]) File "/mnt/09a762a6-3f6e-469b-8d6d-e9fa625e24b9/USER/LuanDD/pyenv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/mnt/09a762a6-3f6e-469b-8d6d-e9fa625e24b9/USER/LuanDD/lanedet/lanedet/models/aggregators/transformer.py", line 152, in forward src = layer(src, pos.to(src.device)) File "/mnt/09a762a6-3f6e-469b-8d6d-e9fa625e24b9/USER/LuanDD/pyenv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/mnt/09a762a6-3f6e-469b-8d6d-e9fa625e24b9/USER/LuanDD/lanedet/lanedet/models/aggregators/transformer.py", line 103, in forward x = self.pre_conv(x) File "/mnt/09a762a6-3f6e-469b-8d6d-e9fa625e24b9/USER/LuanDD/pyenv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/mnt/09a762a6-3f6e-469b-8d6d-e9fa625e24b9/USER/LuanDD/pyenv/lib/python3.6/site-packages/mmcv/cnn/bricks/conv_module.py", line 193, in forward x = self.conv(x) File "/mnt/09a762a6-3f6e-469b-8d6d-e9fa625e24b9/USER/LuanDD/pyenv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/mnt/09a762a6-3f6e-469b-8d6d-e9fa625e24b9/USER/LuanDD/pyenv/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 399, in forward return self._conv_forward(input, self.weight, self.bias) File "/mnt/09a762a6-3f6e-469b-8d6d-e9fa625e24b9/USER/LuanDD/pyenv/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 396, in _conv_forward self.padding, self.dilation, self.groups) RuntimeError: Given groups=1, weight of size [256, 2048, 3, 3], expected input[8, 512, 10, 25] to have 2048 channels, but got 512 channels instead

Inference code 'LineStringsOnImage' object has no attribute 'clip_out_of_image_'

Hi, first of all thanks for everything, great work!

I have a problem running the inference code:

python tools/detect.py configs/laneatt/resnet18_culane.py --img ./05081544_0305-005400.jpg --load_from laneatt_r18_culane.pth --savedir ./test

pretrained model: https://download.pytorch.org/models/resnet18-5c106cde.pth
Traceback (most recent call last):
File "tools/detect.py", line 84, in
process(args)
File "tools/detect.py", line 73, in process
detect.run(p)
File "tools/detect.py", line 47, in run
data = self.preprocess(data)
File "tools/detect.py", line 29, in preprocess
data = self.processes(data)
File "/content/gdrive/My Drive/Staj/lanedet/lanedet/lanedet/datasets/process/process.py", line 35, in call
data = t(data)
File "/content/gdrive/My Drive/Staj/lanedet/lanedet/lanedet/datasets/process/generate_lane_line.py", line 132, in call
line_strings.clip_out_of_image_()
AttributeError: 'LineStringsOnImage' object has no attribute 'clip_out_of_image_'

At first I got the error on this issue: #6 . Than I modify the code as you suggested and now I'm getting this AttributeError. I'm working on google colab if that's relevant.

Thank you.

Get intermediary lane mask

Hi,

Thanks for the awesome work.
In 'tools\detect.py', I wonder if there is a way for me to get the intermediary lane segmentation mask from the models (i.e. as opposed to lane point coordinates)?

Thanks

Inference code

It would be nicer if you can add inference code! And why there is no MobileNet in backbone? Does it not work well for this task?

TypeError: expected string or bytes-like object

python setup.py build develop

File "/home/zzj/anaconda3/envs/Lanedet/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/version.py", line 275, in init
match = self._regex.search(version)
TypeError: expected string or bytes-like object

ubuntu20.04 what can i do?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.