Comments (9)
How do you deal with the dilation operation in conv5? Besides, what are the learning rates in conv5?
from rcf.
Thanks for your answer. I will check my code and report later.
I used tf.nn.conv2d_transpose() to do dilation operation. The weights was bilinear kernel.
TF was hard to set different learning rate for different layer, so I set the all trainable weights as the same leraning rate which are 1e-6 divide by 10 per 10k iteration.
`def upsample_filt(size):
"""
Make a 2D bilinear kernel suitable for upsampling of the given (h, w) size.
"""
factor = (size + 1) // 2
if size % 2 == 1:
center = factor - 1
else:
center = factor - 0.5
og = np.ogrid[:size, :size]
return (1 - abs(og[0] - center) / factor) * (1 - abs(og[1] - center) / factor)
def bilinear_upsample_weights(factor, number_of_classes):
"""
Create weights matrix for transposed convolution with bilinear filter
initialization.
"""
filter_size = get_kernel_size(factor)
weights = np.zeros((filter_size,
filter_size,
number_of_classes,
number_of_classes), dtype=np.float32)
upsample_kernel = upsample_filt(filter_size)
for i in range(number_of_classes):
weights[:, :, i, i] = upsample_kernel
return weights
def deconv(inputs, upsample_factor):
input_shape = tf.shape(inputs)
# Calculate the ouput size of the upsampled tensor
upsampled_shape = tf.stack([input_shape[0],
input_shape[1] * upsample_factor,
input_shape[2] * upsample_factor,
1])
upsample_filter_np = bilinear_upsample_weights(upsample_factor, 1)
upsample_filter_tensor = tf.constant(upsample_filter_np)
# Perform the upsampling
upsampled_inputs = tf.nn.conv2d_transpose(inputs, upsample_filter_tensor,
output_shape=upsampled_shape,
strides=[1, upsample_factor, upsample_factor, 1])
return upsampled_inputs`
from rcf.
As I know, tf.nn.conv2d_transpose() is for deconvolution, not for dilation operation. You may misunderstand me. Maybe you can remove the dilation operation, but please note the upsampling scale.
from rcf.
Thanks. I found my biggest mistake is set the vgg conv_layer's lr = 0 in my code. After fixed, the results are better than before. Next question maybe to set the different learning_rate for different layer. After study this konwledge point, I will report my results.
I'm wondering that can we consider dilation as a resize operation use bilinear kernel.
If this opinion is true, then we set tf.nn.conv2d_transpose(trainable=False) maybe the right way.
I rear your code and found that at Deconv step, you set lr = 0, I guess that is the same as trainable=False in tensorflow operation.
from rcf.
But dilation is different from resizing.
from rcf.
OK..... I will learn the code carefully.
from rcf.
Hi,
I've read the paper 'HED' and 'Fully Convolutional Networks for Semantic Segmentation' .
I think dilation is an simple bilinear interpolation with kernel size f. In the FCN, we call it as backwards convolution (sometimes called deconvolution). Weights can be learned or not is not important. HED proved that learned weights provide no noticeable improvements.
Am I right?
from rcf.
I don't know where you got this information, but dilation is nothing with the deconvolution or bilinear interpolation at all. Dilation is just a Caffe implementation of the well-known hole algorithm. Please refer to some tutorials of deep learning for more help.
from rcf.
Sorry to waste your time...I misunderstand your mean. you mean atrous algorithm. I used
tf.nn.atrous_conv2d(bottom, filt, rate=2, padding='SAME')
to do dilation operation.
hanks for your help.
Its very kind of you!
from rcf.
Related Issues (20)
- How to evaluate the NYUD? HOT 2
- pretrain model无法下载 HOT 1
- 定位公差maxDist HOT 2
- PASCAL VOC边缘集是怎么生成的
- NYUV2数据集获取 HOT 2
- 关于整体分割过程的问题
- 求pytorch版本的预训练ResNet模型
- 求pytorch版本的Resnet预训练模型
- Multicue数据集MaxDist HOT 3
- 关于matlab画精确率-召回率图的问题
- 您好,我想问一下,任意尺寸图片输入后会统一调整为多大? HOT 4
- 数据集 HOT 2
- 输出图片都是黑白的 HOT 4
- 使用pytorch版本跑NYUD数据集时需要更改那些地方的代码呢
- How to plot the curve on Multicue dataset HOT 1
- 关于轮廓细节信息的影响 HOT 2
- 关于multicue数据集的训练 HOT 2
- 关于NYUD-HHA-RGB的结果 HOT 7
- 在自定义数据集上进行evaluation HOT 5
- 我有点无法理解allBench和boundaryBench函数的原理,不知道OIS和ODS是如何计算的
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rcf.