hongyanggao / pixeltcn Goto Github PK
View Code? Open in Web Editor NEWTensorflow Implementation of Pixel Transposed Convolutional Networks (PixelTCN and PixelTCL)
Home Page: https://arxiv.org/abs/1705.06820
License: MIT License
Tensorflow Implementation of Pixel Transposed Convolutional Networks (PixelTCN and PixelTCL)
Home Page: https://arxiv.org/abs/1705.06820
License: MIT License
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
can you share the pretrained model?
Hello, could u tell me where can I get the pretrained model? Thank you.
PixelShuffle refers to Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network
by Shi et. al (2016). Thanks in advance.
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
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
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:
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!
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?
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()
Thanks for your code! Can I directly change the tf.nn.conv2dtranspose() to pixel deconvolutional layer?
How do I perform image segmentation as in this
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.