Giter Site home page Giter Site logo

segdecnet's Introduction

Pytorch Implement of the paper "Segmentation Based Deep-Learning Approach for Surface DefectDetection" https://arxiv.org/abs/1903.08536

Modified little things without changing the accuracy

step1: train segment net

python train_segment.py

step2: train decision net

python train_decision.py

step3: test

python test.py

segdecnet's People

Contributors

seanxyz 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

segdecnet's Issues

about initialize_weight

I think the function of initialize_weight can be:
def initialize_weights(*models):
for model in models:
for m in model.modules():
if isinstance(m, nn.Conv2d):
nn.init.kaiming_normal_(m.weight.data, nonlinearity='relu')
elif isinstance(m, nn.BatchNorm2d):
m.weight.data.fill_(1.)
m.bias.data.fill_(1e-4)
elif isinstance(m, nn.Linear):
m.weight.data.normal_(0.0, 0.0001)
m.bias.data.zero_()

While using ReLU, Kaiming initializing is better.

From raw KolektorSDD dataset to NG and OK

Hi,

Thanks for sharing! Would you mind share how you convert raw KolektorSDD to your NG/OK split dataset? I am working to reproduce all result from the paper(eg different dilation), however the shared GPU do not have cuda 9.0, I would like to reproduce using pytorch and python.

Thanks

about valid result

I trained the segmentation network and got the best result in 50 epochs. However, after 60 epochs the valid result is vanishing. Do you know why it is? Thank you!

error

raise ValueError("num_samples should be a positive integer "
ValueError: num_samples should be a positive integer value, but got num_samples=0

about Target size value error

I'm not able to train the model, since the loss function gives me back a Value error on the target size... do you know ho to fix it?

weird error

File "C:\Users\Administrator\anaconda3\envs\pytorch\lib\multiprocessing\spawn.py", line 138, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.

Wierd Error

When running train_segment.py and train_decision.py, the error occurs:

usage: ipykernel_launcher.py [-h] [--cuda CUDA] [--gpu_num GPU_NUM]
[--worker_num WORKER_NUM]
[--batch_size BATCH_SIZE] [--lr LR] [--b1 B1]
[--b2 B2] [--begin_epoch BEGIN_EPOCH]
[--end_epoch END_EPOCH] [--need_test NEED_TEST]
[--test_interval TEST_INTERVAL]
[--need_save NEED_SAVE]
[--save_interval SAVE_INTERVAL]
[--img_height IMG_HEIGHT] [--img_width IMG_WIDTH]
ipykernel_launcher.py: error: unrecognized arguments: -f /root/.local/share/jupyter/runtime/kernel-b7c2d070-caa1-4edd-9d2d-2fcf3fd83b3e.json

An exception has occurred, use %tb to see the full traceback.

SystemExit: 2

/opt/conda/lib/python3.6/site-packages/IPython/core/interactiveshell.py:2971: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.
warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)

dataset

Hello, thanks for your share. I am confuse about why you divide the data set into trainOK and trainNG. What do NG and OK mean respectively

In segmentation training process, the model can't converge

I try to train the segmentation network in the koltektorSDD Dataset, either the MSEloss, or the BCEloss(), the training process cannot converge~~no matter the lr = 0.005, 0.01,0.1 ...

I use the dilation = 5, and scale(704, 256), and SGD optimizer

Can anyone give me any suggestion?

about loss function

In this paper, the author said the loss function is perfectly crossentropy, but when I modify the MSELoss to CrossEntropy Loss. The code do not work. How to modify the code better? Thank you!

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.