Code Monkey home page Code Monkey logo

pixeltcn's Issues

How does the loss should look like?

For Fire Segmentation problem which has only 2 classes I am getting following loss: batch_size=1
Is that normal. The reason for my suspicion is that I get very different results for neighboring weights for example. Weight of Iter 1540 is very different from 1500
figure_1

For
fire117

Outputs.
iter 1540:
2

iter 1500:
2

Cannot infer num from shape

the code in there:

with tf.variable_scope("upsampling_logits"):
###############################0430#####################
encoder_output_dcl = pixel_dcl(encoder_output, 256, [2,2], scope='pixel_dcl_1',activation_fn=tf.nn.relu,d_format='NHWC')
# net = pixel_dcl(encoder_output_dcl, 256, [2,2], scope='pixel_dcl_2')
##########################################################
net = tf.image.resize_bilinear(encoder_output_dcl, low_level_features_size, name='upsample_1')

traning is normal,but eval is error

pretrained model

Hello, could u tell me where can I get the pretrained model? Thank you.

How to obtain 3D example data

Hi @HongyangGao ,
Could you please share the code for obtaining 3D data from 10 VOC example images,

I want to make fire segmentation app using your source code, cuz other code do not support windows platform.

But since I am new to segmentation, I wondering should I use 2D or 3D data and network.

If not code, any reference articles would be fine too.

Thank you,
Jumabek

2D training example is not working?

So I am trying to do 2D training, using the provided example.
But I am afraid I am doing it wrong, could you please check my Configurations

This is how my Configurations looks like:

   # training
    flags = tf.app.flags
    flags.DEFINE_integer('max_step', 60, '# of step for training')
    flags.DEFINE_integer('test_interval', 100, '# of interval to test a model')
    flags.DEFINE_integer('save_interval', 2, '# of interval to save  model')
    flags.DEFINE_integer('summary_interval', 100, '# of step to save summary')
    flags.DEFINE_float('learning_rate', 1e-3, 'learning rate')
    # data
    flags.DEFINE_string('data_dir', './dataset/', 'Name of data directory')
    flags.DEFINE_string('train_data', 'training.h5', 'Training data')
    flags.DEFINE_string('valid_data', 'validation.h5', 'Validation data')
    flags.DEFINE_string('test_data', 'testing.h5', 'Testing data')
    flags.DEFINE_string('data_type', '2D', '2D data or 3D data')
    flags.DEFINE_integer('batch', 2, 'batch size')
    flags.DEFINE_integer('channel', 3, 'channel size')
    flags.DEFINE_integer('depth', 1, 'depth size')
    flags.DEFINE_integer('height', 256, 'height size')
    flags.DEFINE_integer('width', 256, 'width size')
    # Debug
    flags.DEFINE_string('logdir', './logdir', 'Log dir')
    flags.DEFINE_string('modeldir', './modeldir', 'Model dir')
    flags.DEFINE_string('sampledir', './samples/', 'Sample directory')
    flags.DEFINE_string('model_name', 'model', 'Model file name')
    flags.DEFINE_integer('reload_step', 0, 'Reload step to continue training')
    flags.DEFINE_integer('test_step', 60, 'Test or predict model at this step')
    flags.DEFINE_integer('random_seed', int(time.time()), 'random seed')
    # network architecture
    flags.DEFINE_integer('network_depth', 5, 'network depth for U-Net')
    flags.DEFINE_integer('class_num', 2, 'output class number')
    flags.DEFINE_integer('start_channel_num', 3,
                         'start number of outputs for the first conv layer')

This is the training log:

----training loss 0.439823
----training loss 0.685655
---->saving 2
----training loss 0.716789
----training loss 0.712096
---->saving 4
----training loss 0.683432
----training loss 0.523199
---->saving 6
----training loss 0.49661
----training loss 0.695421
---->saving 8
----training loss 0.356408
----training loss 0.653522
---->saving 10
----training loss 0.483054
----training loss 0.420301
---->saving 12
----training loss 0.442111
----training loss 0.685215
---->saving 14
----training loss 0.356957
----training loss 0.671164
---->saving 16
----training loss 0.594261
----training loss 0.472929
---->saving 18
----training loss 0.531491
----training loss 0.481012
---->saving 20
----training loss 0.348508
----training loss 0.599136
---->saving 22
----training loss 0.505479
----training loss 0.665116
---->saving 24
----training loss 0.703314
----training loss 0.580268
---->saving 26
----training loss 0.465344
----training loss 0.482133
---->saving 28
----training loss 0.333282
----training loss 0.454517
---->saving 30
----training loss 0.475901
----training loss 0.517551
---->saving 32
----training loss 0.410749
----training loss 0.619331
---->saving 34
----training loss 0.488531
----training loss 0.296446
---->saving 36
----training loss 0.642942
----training loss 0.59157
---->saving 38
----training loss 0.449556
----training loss 0.448444
---->saving 40
----training loss 0.421643
----training loss 0.516128
---->saving 42
----training loss 0.445137
----training loss 0.632879
---->saving 44
----training loss 0.631831
----training loss 0.427582
---->saving 46
----training loss 0.468836
----training loss 0.417944
---->saving 48
----training loss 0.505529
----training loss 0.662951
---->saving 50
----training loss 0.604587
----training loss 0.330602
---->saving 52
----training loss 0.444277
----training loss 0.393231
---->saving 54
----training loss 0.291731
----training loss 0.460036
---->saving 56
----training loss 0.550641
----training loss 0.62895
---->saving 58
----training loss 0.47633
----training loss 0.411844
---->saving 60

Is there randomness when predicting the Segmentation Mask

Hi @HongyangGao ,
Help me please!

So I trained Fire Segmentation Network (Below I will paste the conf), the loss is decreased from 0.72 to 0.005 which is good enough to expect something cool from --option=predict.

However, every time I run the main.py --option=predict I get different predictions even though test step(the weights) are the same.
Here is the results from the two runs:
Run 1:
2
2_cv
img__2
fire117_gt

Run 2:
img__2
2
2_cv
fire117_gt

If you see them Run 1 is doing well in regards to seperating fire, but when I run second time I am getting results of Run 2 which is not what I want.

My question is why I am getting two different results for the same input.
I also saw there is a random_seed is used in configure() method, is it because of this variable.

This is my Confs for both of Run1 and Run2:

# training
  flags = tf.app.flags
  flags.DEFINE_integer('max_step', 60000, '# of step for training')
  flags.DEFINE_integer('test_interval', 100, '# of interval to test a model')
  flags.DEFINE_integer('save_interval', 100, '# of interval to save  model')
  flags.DEFINE_integer('summary_interval', 100, '# of step to save summary')
  flags.DEFINE_float('learning_rate', 1e-4, 'learning rate')
  # data
  flags.DEFINE_string('data_dir', r'E:\dataset\patchBasedFireDataset\BowDataset/', 'Name of data directory')
  flags.DEFINE_string('train_data', 'BowDatasettraining.h5', 'Training data')
  flags.DEFINE_string('valid_data', 'BowDatasetvalidation.h5', 'Validation data')
  flags.DEFINE_string('test_data', 'BowDatasettesting.h5', 'Testing data')
  flags.DEFINE_string('data_type', '2D', '2D data or 3D data')
  flags.DEFINE_integer('batch', 1, 'batch size')
  flags.DEFINE_integer('channel', 3, 'channel size')
  flags.DEFINE_integer('depth', 1, 'depth size')
  flags.DEFINE_integer('height', 256, 'height size')
  flags.DEFINE_integer('width', 256, 'width size')
  # Debug
  flags.DEFINE_string('logdir', './logdir', 'Log dir')
  flags.DEFINE_string('modeldir', './modeldir', 'Model dir')
  flags.DEFINE_string('sampledir', './samples/', 'Sample directory')
  flags.DEFINE_string('model_name', 'model', 'Model file name')
  flags.DEFINE_integer('reload_step', 95000, 'Reload step to continue training')
  flags.DEFINE_integer('test_step', 300000, 'Test or predict model at this step')
  flags.DEFINE_integer('random_seed', int(time.time()), 'random seed')
  # network architecture
  flags.DEFINE_integer('network_depth', 5, 'network depth for U-Net')
  flags.DEFINE_integer('class_num', 2, 'output class number')
  flags.DEFINE_integer('start_channel_num', 16,
                       'start number of outputs for the first conv layer')

Thank you for your help,
I do appreciate it!

Questions about kernel_size

Thanks for your contribution. I want to use the pixel_dcl(inputs, out_num, kernel_size, scope, activation_fn=tf.nn.relu, d_format='NHWC') in pixel_dcn.py as the deconvolution layer,can you explain how should I decide the kernel_size?

Error when saving predictions of PixelDCN

Hi thx for the amazing work!

I am trying prediction example on the source code and as usual I have an error which I cannot solve (at least not yet).
Could you please help me Debug this.

The error is occuring in the following line:
https://github.com/HongyangGao/PixelDCN/blob/master/network.py#L280

Thank you.

And this is the call Stack:

---->predicting
inputs.shape:  (1, 16, 256, 256, 1)
----->saving predictions
Traceback (most recent call last):
  File "main.py", line 28, in <module>
    tf.app.run()
  File "C:\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "main.py", line 22, in main
    getattr(model, args.option)()
  File "E:\code\FireSegmentation\PixelDCN\network.py", line 287, in predict
    str(index*prediction.shape[0]+i)+'.png')
  File "E:\code\FireSegmentation\PixelDCN\utils\img_utils.py", line 44, in imsave
    if k < 21:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

parameter question

Hello, I want to replace Transposed Convolution with Pixel Transposed Convolution, which you share. I used pixel_dcl of your pixel_dcn directly, but there is a parameter scope that I don't know what to fill in. What does this parameter relate to and how to fill in?

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.