Git Product home page Git Product logo

deepsegmentor's Introduction

Python 3.5 Packagist Last Commit Maintenance Contributing Open In Colab

DeepSegmentor

A Pytorch implementation of DeepCrack and RoadNet projects.

1.Datasets

Please download the corresponding dataset and prepare it by following the guidance.

2.Installation

We provide an user-friendly configuring method via Conda system, and you can create a new Conda environment using the command:

conda env create -f environment.yml

3.Balancing Weights

We follow the Median Frequency Balancing method, using the command:

python3 ./tools/calculate_weights.py --data_path <path_to_segmentation>

4.Training

Before the training, please download the dataset and copy it into the folder datasets.

  • Crack Detection
sh ./scripts/train_deepcrack.sh <gpu_id>
  • Road Detection
sh ./scripts/train_roadnet.sh <gpu_id>

We provide our pretrained models here:

Model Google Drive Baidu Yun Others
DeepCrack 👌[link] 👌[link](psw: 3fai) Fine-tuned
RoadNet 👌[link] 👌[link](psw: c2gi) Roughly trained
RoadNet++ [link] [link] -

5.Testing

  • Crack Detection
sh ./scripts/test_deepcrack.sh <gpu_id>
Image Ground Truth GF fused side1 side2 side3 side4 side5

[See more examples >>>]

  • Road Detection
sh ./scripts/test_roadnet.sh <gpu_id>
Image Ground Truth Prediction

[See more examples >>>]

6.Evaluation

  • Metrics (appeared in our papers):
Metric Description Usage
P Precision, TP/(TP+FP) segmentation
R Recall, TP/(TP+FN) segmentation
F F-score, 2PR/(P+R) segmentation
TPR True Positive Rate, TP/(TP+FN) segmentation
FPR False Positive Rate, FP/(FP+TN) segmentation
AUC The Area Under the ROC Curve segmentation
G Global accuracy, measures the percentage of the pixels correctly predicted segmentation
C Class average accuracy, means the predictive accuracy over all classes segmentation
I/U Mean intersection over union segmentation
ODS the best F-measure on the dataset for a fixed scale edge,centerline
OIS the aggregate F-measure on the dataset for the best scale in each image edge,centerline
AP the average precision on the full recall range edge,centerline

Note: If you want to apply the standard non-maximum suppression (NMS) for edge/centerline thinning. Please see more details in Piotr's Structured Forest matlab toolbox or some helper functions provided in the hed/eval.

[See more details (Evaluation + Guided Filter + CRF) >>>]

Usage:

cd eval
python eval.py --metric_mode prf --model_name deepcrack --output deepcrack.prf

[Display the accuracy curves >>>]

Acknowledgment

References

If you take use of our datasets or code, please cite our papers:

@article{liu2019deepcrack,
  title={DeepCrack: A Deep Hierarchical Feature Learning Architecture for Crack Segmentation},
  author={Liu, Yahui and Yao, Jian and Lu, Xiaohu and Xie, Renping and Li, Li},
  journal={Neurocomputing},
  volume={338},
  pages={139--153},
  year={2019},
  doi={10.1016/j.neucom.2019.01.036}
}

@article{liu2019roadnet,
  title={RoadNet: Learning to Comprehensively Analyze Road Networks in Complex Urban Scenes from High-Resolution Remotely Sensed Images},
  author={Liu, Yahui and Yao, Jian and Lu, Xiaohu and Xia, Menghan and Wang, Xingbo and Liu, Yuan},
  journal={IEEE Transactions on Geoscience and Remote Sensing},
  volume={57},
  number={4},
  pages={2043--2056},
  year={2019},
  doi={10.1109/TGRS.2018.2870871}
}

If you have any questions, please contact me without hesitation (yahui.cvrs AT gmail.com).

deepsegmentor's People

Contributors

pablodz avatar yhlleo 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

deepsegmentor's Issues

Pretrained weight of RoadNet

Hi, there
You provided roughly trained weight in this repo, but the performance was not so good.
To get the accuracy mentioned in your paper, can you provide the well trained model of RoadNet?

Thanks

Train on my dataset

Hello, I am using my own set of images to train the RoadNet model. I marked it as follows.

006
006
006
006

During training, the target image of visdom only shows a black colour. So can you please tell me, what are those mistakes I might have made?

1640059867(1)

modifications made after paper publication

Hi! I find that the crack segmentation results downloaded from google drive are much better than those in your paper. For example, iou is improved from 85.9 to 87.8. What modifications did you make after paper publication?

labels

hi
How do I make dataset labels?

Web version

Hello there,

I forked the project to create a web app deployed on Heroku free tier to be easy to use as a DEMO of your work.

Some considerations:

  • Only cpu inference (image[png/jpg/jpeg/bmp] and video[mp4] allowed)
  • Automatic resizing input images and video frames (500px).
  • Only DeepCrack
  • "_fused" images taken as output

Web version https://deepcrackcpu.herokuapp.com/
Repo of web version https://github.com/DZDL/crack-detector

[QUESTION] Extract Edge and Centerline Data

Thanks a ton for your work – I try to create a path from the detected edges to compare it with Open Streetmap Data. However I cannot find out where the edges are created or how to work with them. Can I get the edge pixels separated from the "road surface" and the rest? Same applies to centerline which I'd like to separate from the rest of the result.

I am aware that I will not get a path but I want a result similar to
edge

The error of loss function

Thank you for your code. I met this error when I retrain deepcrack model : output with device cuda:0 and dtype Long doesn't match the desired device cuda:0 and dtype Float. Could you give me some advises? thanks.

图片

Issue when loading weights for the deepcrack model

Hello,

First of all thank you very much for releasing the code for the community!

I am facing some problems when trying to test the DeepCrack model. I have downloaded the deepcrack dataset and installed the environment correctly. However, when testing the model the predicted images (side and fused images) are in light gray color. Despite, when loading the model weights provided, I am facing the following issue:

dataset [DeepCrackDataset] was created
initialize network with xavier
model [DeepCrackModel] was created
loading the model from ./checkpoints/deepcrack/pretrained_net_G.pth
Ignoring "Error(s) in loading state_dict for DeepCrackNet:
Unexpected key(s) in state_dict: "conv1.1.weight", "conv1.1.bias", "conv1.4.weight", "conv1.4.bias", "conv2.1.weight", "conv2.1.bias", "conv2.4.weight", "conv2.4.bias", "conv3.1.weight", "conv3.1.bias", "conv3.4.weight", "conv3.4.bias", "conv3.7.weight", "conv3.7.bias", "conv4.1.weight", "conv4.1.bias", "conv4.4.weight", "conv4.4.bias", "conv4.7.weight", "conv4.7.bias", "conv5.1.weight", "conv5.1.bias", "conv5.4.weight", "conv5.4.bias", "conv5.7.weight", "conv5.7.bias".
size mismatch for side_conv1.weight: copying a param of torch.Size([2, 64, 1, 1]) from checkpoint, where the shape is torch.Size([1, 64, 1, 1]) in current model.
size mismatch for side_conv2.weight: copying a param of torch.Size([2, 128, 1, 1]) from checkpoint, where the shape is torch.Size([1, 128, 1, 1]) in current model.
size mismatch for side_conv3.weight: copying a param of torch.Size([2, 256, 1, 1]) from checkpoint, where the shape is torch.Size([1, 256, 1, 1]) in current model.
size mismatch for side_conv4.weight: copying a param of torch.Size([2, 512, 1, 1]) from checkpoint, where the shape is torch.Size([1, 512, 1, 1]) in current model.
size mismatch for side_conv5.weight: copying a param of torch.Size([2, 512, 1, 1]) from checkpoint, where the shape is torch.Size([1, 512, 1, 1]) in current model.
size mismatch for fuse_conv.weight: copying a param of torch.Size([2, 10, 1, 1]) from checkpoint, where the shape is torch.Size([1, 5, 1, 1]) in current model."
---------- Networks initialized -------------
[Network G] Total number of parameters : 14.713 M

Could you please help me?

Abnormal html saved output

After running the test on the crack dataset the processed images in the ./results/deepcrack/test_latest/images folder are incorrect (or shifted or locked).

Schermata del 2021-08-31 12-44-40
Schermata del 2021-08-31 12-43-54

在运行这个代码时并得到可视化结果需要修改哪些参数,和手动创建哪些文件夹呢

我想问一个很简单的问题,但这对我来说很困难,我还没有成功运行这个程序
我做了许多尝试比如
visdom的端口号,deault设置为8123(一开始我使用的默认)
自己创建了一个results文件夹,
但是使用sh ./scripts/train_roadnet.sh 0后,虽然GPU可以工作
但是不知道训练的结果在哪里,在checkpoint里面也没有新的数据
只会在DeepSegmentor/checkpoints/roadnet/loss_log多一行如下的数据
================ Training Loss (Tue Apr 12 20:43:56 2022) ================
请问还需要怎样做呢

Is the evaluation process omitted?

Hi,
@yhlleo ,
Thanks a lot for your work!
I would like to know if you omit the evaluation process during training intentionally?
To my knowledge, The evaluation (differs from test procedure) process is used to evaluate the performance of the network during training, and then select the model weights that got the best performance. So is there any reason to omit the process?

Error in loading pretrained roadnet weights

File: base_model.py Line 197

Error in net.load_state_dict(state_dict)

dataset [RoadNetDataset] was created
initialize network with xavier
model [RoadNetModel] was created
loading the model from ./checkpoints/roadnet/pretrained_net_G.pth
Traceback (most recent call last):
File "test.py", line 20, in
model.setup(opt) # regular setup: load and print networks; create schedulers
File "/home/ibrahim/Desktop/Research/DeepSegmentor/models/base_model.py", line 88, in setup
self.load_networks(load_suffix)
File "/home/ibrahim/Desktop/Research/DeepSegmentor/models/base_model.py", line 197, in load_networks
net.load_state_dict(state_dict)
File "/home/ibrahim/anaconda3/envs/env-yolo/lib/python3.7/site-packages/torch/nn/modules/module.py", line 847, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for RoadNet:
Unexpected key(s) in state_dict: "segment_conv1.1.weight", "segment_conv1.1.bias", "segment_conv1.4.weight", "segment_conv1.4.bias", "segment_conv2.1.weight", "segment_conv2.1.bias", "segment_conv2.4.weight", "segment_conv2.4.bias", "segment_conv3.1.weight", "segment_conv3.1.bias", "segment_conv3.4.weight", "segment_conv3.4.bias", "segment_conv3.7.weight", "segment_conv3.7.bias", "segment_conv4.1.weight", "segment_conv4.1.bias", "segment_conv4.4.weight", "segment_conv4.4.bias", "segment_conv4.7.weight", "segment_conv4.7.bias", "segment_conv5.1.weight", "segment_conv5.1.bias", "segment_conv5.4.weight", "segment_conv5.4.bias", "segment_conv5.7.weight", "segment_conv5.7.bias", "edge_conv1.1.weight", "edge_conv1.1.bias", "edge_conv1.4.weight", "edge_conv1.4.bias", "edge_conv2.1.weight", "edge_conv2.1.bias", "edge_conv2.4.weight", "edge_conv2.4.bias", "edge_conv3.1.weight", "edge_conv3.1.bias", "edge_conv3.4.weight", "edge_conv3.4.bias", "edge_conv4.1.weight", "edge_conv4.1.bias", "edge_conv4.4.weight", "edge_conv4.4.bias", "centerline_conv1.1.weight", "centerline_conv1.1.bias", "centerline_conv1.4.weight", "centerline_conv1.4.bias", "centerline_conv2.1.weight", "centerline_conv2.1.bias", "centerline_conv2.4.weight", "centerline_conv2.4.bias", "centerline_conv3.1.weight", "centerline_conv3.1.bias", "centerline_conv3.4.weight", "centerline_conv3.4.bias", "centerline_conv4.1.weight", "centerline_conv4.1.bias", "centerline_conv4.4.weight", "centerline_conv4.4.bias".
size mismatch for side_segment_conv1.weight: copying a param with shape torch.Size([1, 64, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 64, 1, 1]).
size mismatch for side_segment_conv2.weight: copying a param with shape torch.Size([1, 128, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 128, 1, 1]).
size mismatch for side_segment_conv3.weight: copying a param with shape torch.Size([1, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 256, 1, 1]).
size mismatch for side_segment_conv4.weight: copying a param with shape torch.Size([1, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 512, 1, 1]).
size mismatch for side_segment_conv5.weight: copying a param with shape torch.Size([1, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 512, 1, 1]).
size mismatch for fuse_segment_conv.weight: copying a param with shape torch.Size([1, 5, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 15, 1, 1]).
size mismatch for edge_conv1.0.weight: copying a param with shape torch.Size([32, 4, 3, 3]) from checkpoint, the shape in current model is torch.Size([32, 6, 3, 3]).
size mismatch for side_edge_conv1.weight: copying a param with shape torch.Size([1, 32, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 32, 1, 1]).
size mismatch for side_edge_conv2.weight: copying a param with shape torch.Size([1, 64, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 64, 1, 1]).
size mismatch for side_edge_conv3.weight: copying a param with shape torch.Size([1, 128, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 128, 1, 1]).
size mismatch for side_edge_conv4.weight: copying a param with shape torch.Size([1, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 256, 1, 1]).
size mismatch for fuse_edge_conv.weight: copying a param with shape torch.Size([1, 4, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 12, 1, 1]).
size mismatch for centerline_conv1.0.weight: copying a param with shape torch.Size([32, 4, 3, 3]) from checkpoint, the shape in current model is torch.Size([32, 6, 3, 3]).
size mismatch for side_centerline_conv1.weight: copying a param with shape torch.Size([1, 32, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 32, 1, 1]).
size mismatch for side_centerline_conv2.weight: copying a param with shape torch.Size([1, 64, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 64, 1, 1]).
size mismatch for side_centerline_conv3.weight: copying a param with shape torch.Size([1, 128, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 128, 1, 1]).
size mismatch for side_centerline_conv4.weight: copying a param with shape torch.Size([1, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 256, 1, 1]).
size mismatch for fuse_centerline_conv.weight: copying a param with shape torch.Size([1, 4, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 12, 1, 1]).

Prediction to image

Hi,

Thanks a lot for providing this very useful code. I have a question about your code. Because I saw you used different thresholds to binarize the predicted image, I wonder how the prediction is changed to an image? prediction of the model -> sigmoid -> *255 to array -> image? Thanks!

roadnet评估问题

roadnet评估时,用的这个指令:python eval.py --metric_mode sem --model_name latest_net_G.pth --output roadnet.prf,出现了报错。请问这个指令是这样修改的么

Target size error during train

I'm training on my own dataset the DeepCrack segmentor.

But when I calcuate the loss function for bp with model.optimize_parameters(epoch) # calculate loss functions, get gradients, update network weights, it raises me an error on shapes:

ValueError: Target size (torch.Size([1, 1, 155, 420])) must be the same as input size (torch.Size([1, 2, 155, 420]))

how to solve this?

issue when training the model

Traceback (most recent call last):
  File "train.py", line 32, in <module>
    model.optimize_parameters(epoch)   # calculate loss functions, get gradients, update network weights
  File "/rds/project/t2_vol2/rds-t2-cs056/ll610/Onepiece/zh_data/DeepSegmentor/models/deepcrack_model.py", line 115, in optimize_parameters
    self.backward()             # calculate gradients for G
  File "/rds/project/t2_vol2/rds-t2-cs056/ll610/Onepiece/zh_data/DeepSegmentor/models/deepcrack_model.py", line 103, in backward
    self.loss_side += self.criterionSeg(out, self.label) * w
  File "/home/ll610/miniconda3/envs/deepsegmentor/lib/python3.5/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/rds/project/t2_vol2/rds-t2-cs056/ll610/Onepiece/zh_data/DeepSegmentor/models/deepcrack_networks.py", line 103, in forward
    BCE_loss = self.criterion(inputs, targets)
  File "/home/ll610/miniconda3/envs/deepsegmentor/lib/python3.5/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/ll610/miniconda3/envs/deepsegmentor/lib/python3.5/site-packages/torch/nn/modules/loss.py", line 573, in forward
    reduction=self.reduction)
  File "/home/ll610/miniconda3/envs/deepsegmentor/lib/python3.5/site-packages/torch/nn/functional.py", line 1651, in binary_cross_entropy_with_logits
    loss = input - input * target + max_val + ((-max_val).exp() + (-input - max_val).exp()).log()
RuntimeError: Expected object of type torch.cuda.FloatTensor but found type torch.cuda.LongTensor for argument #2 'other'

I encountered this problem while training your model on a customized dataset, would you please help me with that.
I followed every step as you said but still not working. Have been trying this for 2 days, would really appreciate it if you could help me.

ValueError: signal number 32 out of range

Thank you for using your task.

But I have a question about testing the DeepCrack.sh
Training the DeepCrack file is good, but I've faced the issue about python 3.5.5 maybe.

---------- Networks initialized -------------
[Network G] Total number of parameters : 14.720 M

Exception in thread Thread-1:
Traceback (most recent call last):
File "/opt/anaconda3/envs/deepsegmentor3/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/opt/anaconda3/envs/deepsegmentor3/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/opt/anaconda3/envs/deepsegmentor3/lib/python3.5/multiprocessing/resource_sharer.py", line 139, in _serve
signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
File "/opt/anaconda3/envs/deepsegmentor3/lib/python3.5/signal.py", line 60, in pthread_sigmask
sigs_set = _signal.pthread_sigmask(how, mask)
ValueError: signal number 32 out of range


Upper one is that I faced the issue.
Already I fixed the num_workers=0 but test_deepcrack.sh wasn't working.
What can I do for that issue?
Please check that issue, Thanks for your favor.

test.py error: unregonized arguments

You've put together a fantastic resource here, @yhlleo. Thank you for that.

I'm attempting to perform a test run of RoadNet using the pretrained model you've provided on your dataset, but keep encountering the same error message. When I run sh ./scripts/test_roadnet.sh 0 I get the following print out:

usage: test.py [-h] --dataroot DATAROOT [--name NAME] [--gpu_ids GPU_IDS]
               [--checkpoints_dir CHECKPOINTS_DIR] [--model MODEL]
               [--input_nc INPUT_NC] [--output_nc OUTPUT_NC] [--ngf NGF]
               [--ndf NDF] [--netD NETD] [--netG NETG]
               [--n_layers_D N_LAYERS_D] [--norm NORM] [--init_type INIT_TYPE]
               [--init_gain INIT_GAIN] [--no_dropout]
               [--dataset_mode DATASET_MODE] [--direction DIRECTION]
               [--serial_batches] [--num_threads NUM_THREADS]
               [--batch_size BATCH_SIZE] [--load_size LOAD_SIZE]
               [--crop_size CROP_SIZE] [--max_dataset_size MAX_DATASET_SIZE]
               [--preprocess PREPROCESS] [--no_flip NO_FLIP]
               [--display_winsize DISPLAY_WINSIZE] [--epoch EPOCH]
               [--load_iter LOAD_ITER] [--verbose] [--suffix SUFFIX]
               [--load_width LOAD_WIDTH] [--load_height LOAD_HEIGHT]
               [--use_augment] [--display_sides DISPLAY_SIDES]
               [--num_classes NUM_CLASSES] [--use_selu USE_SELU]
               [--loss_mode LOSS_MODE] [--ntest NTEST]
               [--results_dir RESULTS_DIR] [--aspect_ratio ASPECT_RATIO]
               [--phase PHASE] [--eval] [--num_test NUM_TEST]
test.py: error: unrecognized arguments: 0

As I'm relatively inexperienced when it comes to a project of this scale, and I was unable to figure out why the message was occurring myself, I thought I'd get in touch. I'm wondering if it could be an issue with my set up as I'm working on Windows and have been unable to use conda, working from my own virtual environment instead.

About training

How many epochs did you train the deepcrack on your dataset for fine tuning and obtaining same results of the paper?

Error 803

At the end of Step #5:

RuntimeError: Unexpected error from cudaGetDeviceCount(). Did you run some cuda functions before calling NumCudaDevices() that might have already set an error? Error 803: system has unsupported display driver / cuda driver combination

Evaluation methods

Nice project!

Please update your evaluation methods ASAP so that I can compare it with other segmentation methods easily, thanks!

Training issue due to environment.yml file is not updated

The environment.yml file not updated, and has the exploding gradient issue.

I changed to python 3.8 and Pytorch 2.0.1, and the training ran smoothly. One other thing need to update is the tensor self.label needs to be converted to float before feed into self.criterionSeg, in file deepcrack_model.py.

[checkpoints/deepcrack/opt.txt] DeepCrack model parameters issue

Thank you for your work and code. I run the code according to the method you provided, but my result is much lower than yours.
There are some differences between the parameters in the train_deepcrack.sh file and those in your paper, such as learning rate decay. Maybe this is what caused the lower results when I train the Deepcrack-BN model.
So could you provide the opt.txt file of your Deepcrack-BN and Deepcrack-Aug models? I am sorry to trouble you, thank you again.

testing of images

can we test on images which do not have a ground truth and have no need to calculate accuracy

"All CUDA-capable devices are busy or unavailable" when running on Google Colab

Hello,

I'm trying to run your code using the provided Google Colab notebook but upon issuing the command sudo sh scripts/test_deepcrack.sh 0; I get the following error:

----------------- Options ---------------
             aspect_ratio: 1.0                           
               batch_size: 1                             
          checkpoints_dir: ./checkpoints                 
                crop_size: 256                           
                 dataroot: ./datasets/DeepCrack            [default: None]
             dataset_mode: deepcrack                     
                direction: AtoB                          
            display_sides: 1                             
          display_winsize: 256                           
                    epoch: latest                        
                     eval: False                         
                  gpu_ids: 0                             
                init_gain: 0.02                          
                init_type: xavier                        
                 input_nc: 3                             
                  isTrain: False                           [default: None]
             lambda_fused: 1.0                           
              lambda_side: 1.0                           
              load_height: 0                             
                load_iter: 0                               [default: 0]
                load_size: 256                           
               load_width: 0                             
                loss_mode: focal                         
         max_dataset_size: inf                           
                    model: deepcrack                       [default: test]
               n_layers_D: 3                             
                     name: deepcrack                       [default: experiment_name]
                      ndf: 64                            
                     netD: basic                         
                     netG: resnet_9blocks                
                      ngf: 64                            
               no_dropout: False                         
                  no_flip: 1                             
                     norm: batch                           [default: instance]
                    ntest: inf                           
              num_classes: 1                               [default: 2]
                 num_test: 10000                           [default: 50]
              num_threads: 2                             
                output_nc: 3                             
                    phase: test                          
               preprocess: resize_and_crop               
              results_dir: ./results/                    
           serial_batches: False                         
                   suffix:                               
              use_augment: False                         
                 use_selu: 1                             
                  verbose: False                         
----------------- End -------------------
dataset [DeepCrackDataset] was created
Traceback (most recent call last):
  File "test.py", line 19, in <module>
    model = create_model(opt)      # create a model given opt.model and other options
  File "/content/DeepSegmentor/models/__init__.py", line 65, in create_model
    instance = model(opt)
  File "/content/DeepSegmentor/models/deepcrack_model.py", line 45, in init
    self.gpu_ids)
  File "/content/DeepSegmentor/models/deepcrack_networks.py", line 90, in define_deepcrack
    return init_net(net, init_type, init_gain, gpu_ids)
  File "/content/DeepSegmentor/models/networks.py", line 106, in init_net
    net.to(gpu_ids[0])
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 899, in to
    return self._apply(convert)
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 570, in _apply
    module._apply(fn)
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 570, in _apply
    module._apply(fn)
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 593, in _apply
    param_applied = fn(param)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 897, in convert
    return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
RuntimeError: CUDA error: all CUDA-capable devices are busy or unavailable
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

Do you have any idea on what is going on? I also tried restarting the Colab instance and verifying the GPU status with nvidia-smi but everything looks fine (output below).

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 495.44       Driver Version: 460.32.03    CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Tesla K80           Off  | 00000000:00:04.0 Off |                    0 |
| N/A   66C    P8    30W / 149W |      0MiB / 11441MiB |      0%   E. Process |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Let me know if there is any additional information I can provide to help solving the issue.

Thank you for your time and have a nice day.

how can i achieve your paper's results evaluation?

thank you for your work and code
i download your code and run the program(without afterprocess including gf and crf). i gain image results and evalues them. but metrics are lower than those of your paper.

image
what should i do to improve the results. could you give me some advises?
thank you again

Can I get the crack of a picture that is taken by myself?

Hi, I am trying to use this code to get the crak of a picture that is taken by myself.
I followed the steps described in Readme and I use sh ./scripts/train_deepcrack.sh <gpu_id> for training.
Then I would like to do Crack Detection by executing sh ./scripts/test_deepcrack.sh <gpu_id>.
From my perspective I should add the new testing pictures to datasets/DeepCrack/test_img and by executing sh ./scripts/test_deepcrack.sh <gpu_id> I would get the identified crack images in datasets/DeepCrack/test_lab, however, the program not only requires the images in test_img folder, but also requires images in test_lab, which I thought would be the identified results.
I appreciate if anyone could explain this question to me.

BATCH_SIZE too small?

image

Why do you set the BATCH_SIZE = 1, I think it will make the training really slow.

pytorch=0.4.1

_C:\dl\Repository\Others\DeepSegmentor-master>conda env create -f environment.yml

Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound:

  • pytorch=0.4.1_

Hello,
I am trying to implement the model for a custom dataset but I am having the aforementioned issue. Although I have pytorch=1.1.0 in my own virtual env, even then I am getting an assertion error as below:

(myenv) C:\dl\Repository\Others\DeepSegmentor-master>python ./tools/calculate_weights.py --data_path C:\dl\Repository\Others\DeepSegmentor-master\tools
{}
Traceback (most recent call last):
File "./tools/calculate_weights.py", line 60, in
print(reverse_weight(weights))
File "./tools/calculate_weights.py", line 43, in reverse_weight
assert len(w) > 0, "Expected a non-empty weight dict."
AssertionError: Expected a non-empty weight dict.

What should I do to solve this?

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.