drsleep / tensorflow-deeplab-lfov Goto Github PK
View Code? Open in Web Editor NEWDeepLab-LargeFOV implemented in tensorflow
License: MIT License
DeepLab-LargeFOV implemented in tensorflow
License: MIT License
I use your default parameters for training
python train.py --restore_from ./model.ckpt.pretrained
however, the model will diverage after 11000 iterations
Thank you!
can i use the pretrained model from authors? how?
If I want to train a new model on my own data, how to change the number of segmented classes ?
In function read_images_from_disk( )
h_new = tf.to_int32(tf.mul(tf.to_float(tf.shape(img)[1]), scale))
w_new = tf.to_int32(tf.mul(tf.to_float(tf.shape(img)[1]), scale))
h_new and w_new have the same value
Hello, When I load the ckpt, there is an error.
path = '/home/wam/DeepLab/model/model.ckpt-pretrained'
f = open(path, 'rb')
weights = cPickle.load(f)
Traceback (most recent call last):
File "", line 1, in
EOFError
Hi, Author, thanks for your work, but I am wondering if I start with only the deeplab_resnet_init.ckpt, and trained my own model with my own set of images, I don't see a deeplab_resnet.ckpt in my folder, I wonder where is the trained model stored and How can I use them.
thanks
I has been used the data of VOC2012 and the your code to train the models, but the predicts was all 0s during train process. Would you give me some advises. Thank you very much.
For example, the training process stoped after 20K iterations. How to continue training from 20K iterations?
Hi
It seems that the author did not provide the init.model in the homepage. Can you point out which init.caffemodel are you using? By the way, the init model is trained on the coco dataset or not?
Is there an issue with the decode_label code? I've been working on segmented masks with .gif extension but it throws an error. Here is the stack.
W tensorflow/core/framework/op_kernel.cc:993] Invalid argument: Invalid PNG header, data size 5913
[[Node: create_inputs/DecodePng = DecodePngchannels=1, dtype=DT_UINT8, _device="/job:localhost/replica:0/task:0/cpu:0"]]
W tensorflow/core/framework/op_kernel.cc:993] Invalid argument: Invalid PNG header, data size 5913
[[Node: create_inputs/DecodePng = DecodePngchannels=1, dtype=DT_UINT8, _device="/job:localhost/replica:0/task:0/cpu:0"]]
W tensorflow/core/framework/op_kernel.cc:993] Invalid argument: Invalid PNG header, data size 5913
[[Node: create_inputs/DecodePng = DecodePngchannels=1, dtype=DT_UINT8, _device="/job:localhost/replica:0/task:0/cpu:0"]]
W tensorflow/core/framework/op_kernel.cc:993] Out of range: FIFOQueue '_1_create_inputs/batch/fifo_queue' is closed and has insufficient elements (requested 16, current size 0)
[[Node: create_inputs/batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_UINT8], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](create_inputs/batch/fifo_queue, create_inputs/batch/n)]]
What is the difference between model.ckpt-initand
model.ckpt-pretrained` files?
Is the model.ckpt-pretrained the final model for PASCAL 2012 ? I used it for evaluate.py, but only got Mean IoU: 0.059 on val.txt
Hi, I follow the resnet branch by adding momentum, weight decay and learning rate schedule. However, the results didn't improve much. The final model are worse than the model.ckpt-pretrained.
Hi,
Thanks a lot for open-source this code. It is very helpful. However, I run into a problem when running the evaluation code on validation set. I did not change anything but just load the model.ckpt-pretrained. But surprisingly, it gets 70.4 instead of 67 as mentioned in the README. Can I ask you what could be the reason?
Thanks a lot!
When I tried to use the converted model like "model.ckpt-init" or "model.ckpt-pretrained", I met the following error:
Traceback (most recent call last):
File "/home/wxy/Proj/test.py", line 21, in
model = DeepLFOV(weights_path)
......
File "/home/wxy/Proj/test.py", line 53, in _create_variable
weights = cPickle.load(f) # load pre-trained weights
EOFError
@DrSleep Hi sir, I wish you can help me with this,
What is the top-level directory of the model you are using:
https://github.com/tensorflow/models/tree/master/research/deeplab
** Have I written custom code (as opposed to using a stock example script provided in TensorFlow):**
No
**OS Platform and Distribution (e.g., Linux Ubuntu 16.04):**ubuntu 18.04
**TensorFlow installed from (source or binary):**binary
**TensorFlow version (use command below):**1.13.1 CPU
**Bazel version (if compiling from source):**N/A
**CUDA/cuDNN version:**9.2/7.1
**GPU model and memory:**GeForce GTX 970M
Exact command to reproduce:
python train.py \ --logtostderr \ --vis_split = "train" \ --model_variant = "xception_65" \ --atrous_rates = 6 \ --atrous rates = 12 \ --atrous rates = 18 \ --output_stride = 16 \ --decoder_output_stride = 4 \ --training_number_of_steps = 1000 --train_crop_size = 513 \ --train_batch_size = 1 \ --train_crop_size = 513 \ --Fine_tune_batch_norm=False \ --Tf_initial_checkpoint = "./ Data / Init_models / Deelabv3_pascal_train_aug \ model.ckpt" --Initialize_last_layer = False \ --Last_layers_contain_logits_only = True \ --train_logdir="./data/log/train" \ --dataset_dir="./data/tfrecord" \ --dataset="pascal_voc_seg"
Hi i trained deeplab model and does not predict anything just a black background, i don't know what's the problem
-training on custom dataset (iris data)
-data = RGB image + ( 0-1) label: 400 * 300
-classe=2
-convert to record format:
-training step:
==> Loss = 0.2 ~ 0.1
-convert to .pb step
python export_model.py \ --logtostderr \ -model_variant = "xception_65" \ --atrous_rates = 6 \ --atrous_rates = 12 \ --atrous_rates = 18 \ --output_stride = 16
until this step everything looks fine
-test step
Hi,
I'm trying to train the model using their train and validation files (train.txt, val.txt in the repositorie) but I have several images missing.
I download the file from the PASCAL Visual Object Classes site, the file was:
VOCtrainval_11-May-2012.tar (1,9 Gb)
But this tar containt only 2913 segmented images, your train.txt have ~10000 images
An other problem is that you path to the segmented images is "/SegmentationClassAug/" but this folder doesn't exists. Only exist "SegmentationClass" and "SegmentationObject"
What is the correct dataset to replicate your treinament?
Regards
Hello DrSleep,
I am not sure whether it is appropriate to ask here, but the tensorflow-deeplab-resnet repo did not contain vgg backbone currently. Therefore, I was trying to modify your lfov codes to use vgg deeplab_v2 structure (i.e. no avg_pool5, and ASPP on fc6 with 4 different atrous holes and sum them up at fc8). Below is the codes I modified (also I modified the network structure "net_skeleton.ckpt" in util folder):
@@ -112,7 +112,7 @@ class DeepLabLFOVModel(object):
v_idx = 0 # Index variable.
# Last block is the classification layer.
- for b_idx in xrange(len(dilations) - 1):
+ for b_idx in xrange(len(dilations) - 3):
for l_idx, dilation in enumerate(dilations[b_idx]):
w = self.variables[v_idx * 2]
b = self.variables[v_idx * 2 + 1]
@@ -138,18 +138,34 @@ class DeepLabLFOVModel(object):
ksize=[1, ks, ks, 1],
strides=[1, 1, 1, 1],
padding='SAME')
- current = tf.nn.avg_pool(current,
- ksize=[1, ks, ks, 1],
- strides=[1, 1, 1, 1],
- padding='SAME')
- elif b_idx <= 6:
- current = tf.nn.dropout(current, keep_prob=keep_prob)
+
+ current_before_fc = current
+ fc_layers = []
+ for i in range(len(dilations[5])): # dilations[5] = [6, 12, 18, 24]
+ w = self.variables[v_idx * 2]
+ b = self.variables[v_idx * 2 + 1]
+ v_idx += 1
+ conv = tf.nn.atrous_conv2d(current_before_fc, w, dilations[5][i], padding='SAME')
+ current = tf.nn.relu(tf.nn.bias_add(conv, b))
+ current = tf.nn.dropout(current, keep_prob=keep_prob)
+
+ w = self.variables[v_idx * 2]
+ b = self.variables[v_idx * 2 + 1]
+ v_idx += 1
+ conv = tf.nn.conv2d(current, w, strides=[1, 1, 1, 1], padding='SAME')
+ current = tf.nn.relu(tf.nn.bias_add(conv, b))
+ current = tf.nn.dropout(current, keep_prob=keep_prob)
+
+ w = self.variables[v_idx * 2]
+ b = self.variables[v_idx * 2 + 1]
+ v_idx += 1
+ conv = tf.nn.conv2d(current, w, strides=[1, 1, 1, 1], padding='SAME')
+ current = tf.nn.bias_add(conv, b)
+
+ fc_layers.append(current)
+
+ current = tf.add_n(fc_layers)
- # Classification layer; no ReLU.
- w = self.variables[v_idx * 2]
- b = self.variables[v_idx * 2 + 1]
- conv = tf.nn.conv2d(current, w, strides=[1, 1, 1, 1], padding='SAME')
- current = tf.nn.bias_add(conv, b)
return current
It is able to run by loading the trained model provided by http://liangchiehchen.com/projects/released/deeplab_aspp_vgg16/prototxt_and_model.zip. However, the evaluation is terrible, the mean IoU is only 0.5%. (It works good on the original lfov vgg version)
Would you please kindly give me some hints about this issue so that I can create a pull request to include the vgg deeplab_v2 structure?
Thanks!
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.