Giter Site home page Giter Site logo

rcf's Introduction

We have released the code and data for plotting the edge PR curves of many existing edge detectors here.

Citation

If you are using the code/model/data provided here in a publication, please consider citing:

@article{liu2019richer,
  title={Richer Convolutional Features for Edge Detection},
  author={Liu, Yun and Cheng, Ming-Ming and Hu, Xiaowei and Bian, Jia-Wang and Zhang, Le and Bai, Xiang and Tang, Jinhui},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
  volume={41},
  number={8},
  pages={1939--1946},
  year={2019},
  publisher={IEEE}
}

PyTorch version of RCF

For the PyTorch implementation of RCF, please refer to this repository: yun-liu/RCF-PyTorch (a clean version of balajiselvaraj1601/RCF_Pytorch_Updated). Thanks for Balaji's contribution! This PyTorch implementation can reproduce the accuracy of the Caffe version.

Jittor version of RCF

For the Jittor implementation of RCF, please refer to this repository: yun-liu/RCF-Jittor.

Evaluation results

Evaluation results on the BSDS500 and NYUD datasets are available here.

Precomputed results

The precomputed edge maps for BSDS500 dataset are available here.

The precomputed segmentation results (UCM2, generated by RCF+COB) for BSDS500 and NYUD datasets are available here.

Pretrained models

RCF model for BSDS500 dataset is available here.

RCF model for NYUD dataset is available here (Depth and Image).

Testing RCF

  1. Clone the RCF repository

    git clone https://github.com/yun-liu/rcf.git
    
  2. Download pretrained models, and put them into the $ROOT_DIR/examples/rcf/ folder.

  3. Download the datasets you need as below, and extract these datasets to the $ROOT_DIR/data/ folder.

    wget http://mftp.mmcheng.net/liuyun/rcf/data/bsds_pascal_train_pair.lst
    wget http://mftp.mmcheng.net/liuyun/rcf/data/HED-BSDS.tar.gz
    wget http://mftp.mmcheng.net/liuyun/rcf/data/PASCAL.tar.gz
    wget http://mftp.mmcheng.net/liuyun/rcf/data/NYUD.tar.gz
    
  4. Build Caffe.

  5. Go into the folder $ROOT_DIR/examples/rcf/. Then, you can run RCF-singlescale.ipynb to test single-scale RCF on the BSDS500 dataset, or run RCF-multiscale.ipynb to test multiscale RCF on the BSDS500 dataset, or run RCF-singlescale-NYUD.ipynb to test single-scale RCF on the NYUD dataset.

Note: Before evaluating the predicted edges, you should do the standard non-maximum suppression (NMS) and edge thinning. We used the Piotr's Structured Forest matlab toolbox available here.

Training RCF

  1. Download the datasets you need.

  2. Download the pretrained vgg16 model here.

  3. Start training process by running the following commands:

    cd $ROOT_DIR/examples/rcf/
    ./train.sh
    

ResNet version of RCF

The code for the ResNet version of RCF has been released. The pretrained ImageNet and BSDS500 models are available here. Some discussion can be found under the issue #89.

What is the "AutoCrop" layer?

The "AutoCrop" layer in RCF can caculate the crop offset automatically, and the recent version of Caffe doesn't support this. In fact, we can calculate the crop offset by ourselves, so we can replace the "AutoCrop" layer with the standard Crop layer in Caffe by setting the offsets to 1, 2, 4, and 0 for conv2, conv3, conv4, and conv5, respectively. More details can be found under the issue #24.

Acknowledgments

This code is based on HED (s9xie/hed). Thanks to the contributors of HED.

rcf's People

Contributors

kant avatar yun-liu 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  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

rcf's Issues

About training processing

I adjusted some parameters for training and it can successfully make a fine tuning for my own training data. I made a 40000 iterations for the first fine tuning. After the fine tuning, can I show loss values by a graph based on log files? Also, can I show a graph on accuracy ? How should I do for such purpose ?
By the way, I make predict on my own data, and the fine-tuned model can perform very well, but I wonder whether it is over-fitted. Do you know how to confirm whether the fine-tuned model is over-fitted ?

what should I do after get results through rcf-singlescale-nyud??

There is a saying In your paper:

When evaluating, standard NMS is applied to thin detected deges

However, the note in this READ.ME point out that we should do NMS and edge thinning. I am quite confused now...Is there one step or two? Have the results I got from rcf-singlescale-nyud already been done NMS or NOT?I have got the tools about your link. It seems like another way to train a model and evaluate results. Thanks a lot!

why choose multiscale 0.5 1 1.5

MR.Liu, you said in the article that "To further improve the quality of edges, we use image pyramids during testing" why did you choose the scale like "0.5 1 1.5 "

liu师兄你好,请问多尺度融合为什么要选择0.5 1 1.5这三个比例,我也发现加入升采样的比例后对边缘检测效果更好,但是对图片进行升采样后图片的细节丢失,为什么还会达到好的效果呢?

Question about the parameters η and λ

Hello,

I am very interested in your network. As mentioned in your paper, "The parameters η and λ in loss function are also set depending on training data". But, I cannot find these parameters in the configure file ('solver.prototxt'). Where can I set these parameters (maybe, in the source code) ?

Thank you very much.

Evaluating result on NYUD.

I'm sorry to disturb you again...
I want to evaluate NYUD result, I downloaded NUYDv2 from the official website.
I found that there is only on big '.mat' file, but Piotr's Structured Forest matlab toolbox need one '.mat' file for each image, should I extracut ifnormation from the big '.mat' file?
Or I miss understand the whole process?
Thanks for your time.

How to use edge_nms.m?

安装了Piotr's Structured Edge toolbox,由于edge_nms.m找不到edgesNms函数,将该函数改为edgesNmsMex,发现报错Undefined function 'edgesNmsMex' for input arguments of type 'single'.
请问能不能给个具体的使用说明,卡在这边了,有点着急。
还有非极大值抑制后,bsds500的benchmark怎么使用呢?

Predict by CPU

I want to use CPU-only to make a edge detection by rcf, and I have revised Makefile.config to commet "USE_CUDNN := 1" and unconment "CPU_ONLY := 1", and re-build and re-install caffe. But when I run predict, one error occured like the followings:


F1115 15:03:29.547533 6127 cudnn_relu_layer.cpp:13] Check failed: status == CUDNN_STATUS_SUCCESS (1 vs. 0) CUDNN_STATUS_NOT_INITIALIZED

Is there anyone know how to solve such a problem ?
Besides, the model I fine-tuned is trained by GPU.

Build caffe: make runtest error

Sorry to bother you! I just run the rcf on my computer with Ubuntu+caffe+cpu, then came across some errors in building caffe when I make runtest , these errors were listed below, hope you or somebody can help me, thanks!

[----------] Global test environment tear-down
[==========] 1096 tests from 150 test cases ran. (37180 ms total)
[ PASSED ] 1092 tests.
[ FAILED ] 4 tests, listed below:
[ FAILED ] SigmoidCrossEntropyLossLayerTest/0.TestSigmoidCrossEntropyLoss, where TypeParam = caffe::CPUDevice
[ FAILED ] SigmoidCrossEntropyLossLayerTest/0.TestGradient, where TypeParam = caffe::CPUDevice
[ FAILED ] SigmoidCrossEntropyLossLayerTest/1.TestGradient, where TypeParam = caffe::CPUDevice
[ FAILED ] SigmoidCrossEntropyLossLayerTest/1.TestSigmoidCrossEntropyLoss, where TypeParam = caffe::CPUDevice

4 FAILED TESTS
Makefile:526: recipe for target 'runtest' failed
make: *** [runtest] Error 1

Some questions about train model using different datasets?

您好:
我有几个训练方面的问题想问一下,问题有点多,希望不要嫌弃。
(1)在使用BSDS500和PASCAL数据训练的时候,是分两次训练呢,还是合成一个数据集训练?
(2)如果分两次训练的话。先后顺序是什么样的呢?第2个数据集训练时会影响第一个数据集的训练好的权重,这对结果没有影响吗?
(3)在训练NYUD时,训练数据用的您发布的,但评价指标时,测试数据的.mat类型的ground truth是要去原始数据集中找吗,在您的数据中好像没有看到?

Train my own dataset

I use rcf to train my own dataset, and the loss is more than 50000. But when I test the model, the performance is ok. So, what's the problem? When converge, how big the loss should be?

About loss

Hi, you set dsn1_loss、dsn2_loss、dsn3_loss、dsn4_loss、dsn5_loss and fuse_loss. I want to ask if these loss needs backward computation respectively? But I do not know why not sum them? I do not know how do these loss work respectively.I am trying to implement your code in PyTorch. Could you help me ? Thanks a lot!

the NYUDV2 test GT

apology for bother you, but i haven't found the gt of test set, could you tell me where can find or get it, thanks a lot.

请教下rcf训练的一些问题

@yun-liu 你好我是在https://github.com/happynear/caffe-windows的caffe代码上
添加image_labelmap_data_layer等层,但是没有加AutoCrop层,参考#24 用Crop层替代
成功编译出libcaffe.lib和caffe.exe(没有编译caffe的python版本),目前用http://mftp.mmcheng.net/liuyun/rcf/data/HED-BSDS.tar.gz 这个数据训练。
因为没有编译caffe的python版本,所以没有用solve.py,
直接"caffe.exe" train --solver=/solver.prototxt -gpu=0

一些log如下: fuse_loss在几千到几万波动
0805 23:26:13.153472 20696 solver.cpp:336] Iteration 0, Testing net (#0)
I0805 23:26:16.867991 20696 solver.cpp:224] Iteration 0 (-2.73941e-35 iter/s, 3.73482s/50 iters), loss = 542030
I0805 23:26:16.867991 20696 solver.cpp:243] Train net output #0: dsn1_loss = 125365 (* 1 = 125365 loss)
I0805 23:26:16.867991 20696 solver.cpp:243] Train net output #1: dsn2_loss = 125365 (* 1 = 125365 loss)
I0805 23:26:16.867991 20696 solver.cpp:243] Train net output #2: dsn3_loss = 125365 (* 1 = 125365 loss)
I0805 23:26:16.867991 20696 solver.cpp:243] Train net output #3: dsn4_loss = 125365 (* 1 = 125365 loss)
I0805 23:26:16.867991 20696 solver.cpp:243] Train net output #4: dsn5_loss = 125365 (* 1 = 125365 loss)
I0805 23:26:16.867991 20696 solver.cpp:243] Train net output #5: fuse_loss = 125365 (* 1 = 125365 loss)
I0805 23:26:16.867991 20696 sgd_solver.cpp:137] Iteration 0, lr = 0.0001
I0805 23:26:17.039825 20696 sgd_solver.cpp:200] weight diff/data:nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan 0.000000 nan nan 0.000000 nan nan nan 0.000000 nan nan nan 0.000000 nan nan nan 0.000000 0.000000
I0805 23:28:52.964601 20696 solver.cpp:224] Iteration 50 (0.320336 iter/s, 156.086s/50 iters), loss = 394900
I0805 23:28:52.964601 20696 solver.cpp:243] Train net output #0: dsn1_loss = 4003.08 (* 1 = 4003.08 loss)
I0805 23:28:52.964601 20696 solver.cpp:243] Train net output #1: dsn2_loss = 18340.7 (* 1 = 18340.7 loss)
I0805 23:28:52.964601 20696 solver.cpp:243] Train net output #2: dsn3_loss = 18340.7 (* 1 = 18340.7 loss)
I0805 23:28:52.964601 20696 solver.cpp:243] Train net output #3: dsn4_loss = 18340.7 (* 1 = 18340.7 loss)
I0805 23:28:52.964601 20696 solver.cpp:243] Train net output #4: dsn5_loss = 18340.7 (* 1 = 18340.7 loss)
I0805 23:28:52.964601 20696 solver.cpp:243] Train net output #5: fuse_loss = 3454.18 (* 1 = 3454.18 loss)
......
......
......
I0806 08:36:02.148245 20696 solver.cpp:224] Iteration 10900 (0.338876 iter/s, 147.546s/50 iters), loss = 372257
I0806 08:36:02.148245 20696 solver.cpp:243] Train net output #0: dsn1_loss = 2914.58 (* 1 = 2914.58 loss)
I0806 08:36:02.148245 20696 solver.cpp:243] Train net output #1: dsn2_loss = 18340.7 (* 1 = 18340.7 loss)
I0806 08:36:02.148245 20696 solver.cpp:243] Train net output #2: dsn3_loss = 18340.7 (* 1 = 18340.7 loss)
I0806 08:36:02.148245 20696 solver.cpp:243] Train net output #3: dsn4_loss = 18340.7 (* 1 = 18340.7 loss)
I0806 08:36:02.148245 20696 solver.cpp:243] Train net output #4: dsn5_loss = 18340.7 (* 1 = 18340.7 loss)
I0806 08:36:02.148245 20696 solver.cpp:243] Train net output #5: fuse_loss = 2914.54 (* 1 = 2914.54 loss)
I0806 08:36:02.148245 20696 sgd_solver.cpp:137] Iteration 10900, lr = 1e-05
I0806 08:36:02.288869 20696 sgd_solver.cpp:200] weight diff/data:nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan 0.001091 nan nan 0.000000 nan nan nan 0.000000 nan nan nan 0.000000 nan nan nan 0.000000 0.000010
I0806 08:38:34.147261 20696 solver.cpp:224] Iteration 10950 (0.328973 iter/s, 151.988s/50 iters), loss = 385102
I0806 08:38:34.147261 20696 solver.cpp:243] Train net output #0: dsn1_loss = 12236.3 (* 1 = 12236.3 loss)
I0806 08:38:34.147261 20696 solver.cpp:243] Train net output #1: dsn2_loss = 51659.6 (* 1 = 51659.6 loss)
I0806 08:38:34.147261 20696 solver.cpp:243] Train net output #2: dsn3_loss = 51659.6 (* 1 = 51659.6 loss)
I0806 08:38:34.147261 20696 solver.cpp:243] Train net output #3: dsn4_loss = 51659.6 (* 1 = 51659.6 loss)
I0806 08:38:34.147261 20696 solver.cpp:243] Train net output #4: dsn5_loss = 51659.6 (* 1 = 51659.6 loss)
I0806 08:38:34.147261 20696 solver.cpp:243] Train net output #5: fuse_loss = 12235.3 (* 1 = 12235.3 loss)
I0806 08:38:34.147261 20696 sgd_solver.cpp:137] Iteration 10950, lr = 1e-05

然后在OpenCV上用训练了一万次的模型提取边缘试试看,结果是全黑的图像,这说明我训练次数不够多还是其他问题呢?用你的rcf_pretrained_bsds.caffemodel的提取边缘的效果很好。
所以我想请教你几个问题

  1. 必须要用solve.py的方式来训练吗? 我看solve.py主要做了两个事情:
    一个是用interp_surgery函数给deconvolution层初始化,想问下这个是必须的吗?deconvolution能像普通的卷积一样能通过训练自己学习出来吗? 看https://www.zhihu.com/question/63890195/answer/214223863,deconvolution也可以用 weight_filler: { type: "bilinear" },这个是不是和interp_surgery函数同样的作用?
    还有一个是从'5stage-vgg.caffemodel'恢复 weights做fine-tuning,我想问下不做fine-tuning,直接HED-BSDS数据训练可行吗?还有一种情况就是比如我自己修改了一个模型结构完全不能用'5stage-vgg.caffemodel'做fine-tuning的话,那怎么办?

  2. 还有我看了caffe-windows的sigmoid_cross_entropy_loss_layer_caffe.cpp是和官方的caffe的代码一样,但是和你项目里的
    sigmoid_cross_entropy_loss_layer_caffe.cpp是不一样的,我一开始没注意到这个差异,想问下,训练rcf模型必须用你这个sigmoid_cross_entropy_loss_layer_caffe.cpp吗?

  3. 是不是训练的迭代次数不够多?

  4. 考虑到我不是fine-tuning,我把base_lr从 1e-6 增大到 1e-4,这个影响大吗?

How to evaluate on BSDS500 benchmark?

First I would appreciate the released repos of RCF and related ploting codes.

I've trained the RCF edge detector on BSDS500 dataset (yes, originally, instead of my own dataset, and with default training hyper-parameters). Now evaluating on BSDS500 benchmark, have some problems.

As metioned in readme.md, non-maximum suppression and edge thinning, are two acquired steps before evaluation. I installed Piotr Dollar's toolbox and edge detection code, and successfully get the results of nms-ed edges, saved in png images.

However, whether doing edge thinning or not, the BSDS500 benchmark's code, always give complains that the indexes are 0, which should be greater than or equal to 1. I notice that this is caused by, the automatically generated thresholding values are from 0.01 to higher ones, and the pixel values after binarization (via bwlabel in matlab) contains 0 values.

Wondering if you have encounterd same problem, if so, would you provide some suggestions? Thank you.

About cmake

I wonder what parameters should I set for cmake command ? I tried the following parameters:


cmake -D CMAKE_BUILD_TYPE=RELEASE -D BUILD_PYTHON_SUPPORT=ON -D CMAKE_INSTALL_PREFIX=/usr/local ..

But some error occurs, like :


CMake Error at CMakeLists.txt:74 (add_subdirectory):
The source directory

xxxxxx/rcf/examples

does not contain a CMakeLists.txt file.

CMake Error at docs/CMakeLists.txt:82 (file):
file STRINGS file "xxxxxx/rcf/.Doxyfile"
cannot be read.

-- Can't find OUTPUT_DIRECTORY in doxygen config file. Try to use default: ./doxygen/

Could you please give me some advice about cmake ?

How to build caffe?

Hello,I try to run the RCF.
But,i can't understand "Build caffe" in step 4.
Could you introduce the delails of the steps?
Thanks a lot!

Got error wile running RCF-singlescale.pynb

Hi @yun-liu ,

I tried to find edges of my own image from NYUD trained model using RCF-singlescale.pynb.

But when I tried to convert image numpy array and subtract array from the image I got the following error.

The following code I was trying to execute

im_lst = []
for i in range(0, len(test_lst)):
#print data_root+test_lst[i]
im = Image.open(data_root+test_lst[i])
#im.show()
in
= np.array(im, dtype=np.float32)
in_ = in_[:,:,::-1]
#print in_
in_ -= np.array((104.00698793,116.66876762,122.67891434))
im_lst.append(in_)_

The following error I got:

**---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in ()
7 in
= in_[:,:,::-1]
8 #print in_
----> 9 in_ -= np.array((104.00698793,116.66876762,122.67891434))
10 im_lst.append(in_)

ValueError: operands could not be broadcast together with shapes (365,492,4) (3,) (365,492,4)_**

the result of side_output5 is bad

Hi, Dr liu:
Thanks for your attention.
I'm try to implament this work with tensorflow. After train I find that side_output 1-4 look like the result in your paper, but output 5 is bad. Can't find the reason.
The same result of 1-4 pove that my model is right, but that can explain the output 5.
Can you give me some advice from your rich experience which may not connect with tensorflow?
Attachments are my results.
side_output_1
side_output_2
side_output_3
side_output_4
side_output_5

about dataset

您好,如果我想用自己的数据集来训练,请问怎么来标记我的数据呢

run ./train.sh loss is too big

when i run the ./train.sh , the log output like fllowing:
..........
0302 19:12:14.613809 31026 sgd_solver.cpp:106] Iteration 6340, lr = 1e-06
I0302 19:12:38.769260 31026 solver.cpp:228] Iteration 6360, loss = 10621.1
I0302 19:12:38.769335 31026 solver.cpp:244] Train net output #0: dsn1_loss = 0 (* 1 = 0 loss)
I0302 19:12:38.769345 31026 solver.cpp:244] Train net output #1: dsn2_loss = 0 (* 1 = 0 loss)
I0302 19:12:38.769351 31026 solver.cpp:244] Train net output #2: dsn3_loss = 0 (* 1 = 0 loss)
I0302 19:12:38.769356 31026 solver.cpp:244] Train net output #3: dsn4_loss = 0 (* 1 = 0 loss)
I0302 19:12:38.769361 31026 solver.cpp:244] Train net output #4: dsn5_loss = 0 (* 1 = 0 loss)
I0302 19:12:38.769366 31026 solver.cpp:244] Train net output #5: fuse_loss = 0 (* 1 = 0 loss)
I0302 19:12:38.769388 31026 sgd_solver.cpp:106] Iteration 6360, lr = 1e-06
I0302 19:13:03.462623 31026 solver.cpp:228] Iteration 6380, loss = 11332.3
I0302 19:13:03.462703 31026 solver.cpp:244] Train net output #0: dsn1_loss = 7039.19 (* 1 = 7039.19 loss)
I0302 19:13:03.462718 31026 solver.cpp:244] Train net output #1: dsn2_loss = 5792.09 (* 1 = 5792.09 loss)
I0302 19:13:03.462725 31026 solver.cpp:244] Train net output #2: dsn3_loss = 4685.93 (* 1 = 4685.93 loss)
I0302 19:13:03.462733 31026 solver.cpp:244] Train net output #3: dsn4_loss = 4729.02 (* 1 = 4729.02 loss)
I0302 19:13:03.462740 31026 solver.cpp:244] Train net output #4: dsn5_loss = 4076.09 (* 1 = 4076.09 loss)
I0302 19:13:03.462749 31026 solver.cpp:244] Train net output #5: fuse_loss = 4297.43 (* 1 = 4297.43 loss)
I0302 19:13:03.462755 31026 sgd_solver.cpp:106] Iteration 6380, lr = 1e-06
I0302 19:13:27.423714 31026 solver.cpp:228] Iteration 6400, loss = 11654.9
I0302 19:13:27.423781 31026 solver.cpp:244] Train net output #0: dsn1_loss = 323.811 (* 1 = 323.811 loss)
I0302 19:13:27.423807 31026 solver.cpp:244] Train net output #1: dsn2_loss = 309.62 (* 1 = 309.62 loss)
I0302 19:13:27.423815 31026 solver.cpp:244] Train net output #2: dsn3_loss = 266.862 (* 1 = 266.862 loss)
I0302 19:13:27.423821 31026 solver.cpp:244] Train net output #3: dsn4_loss = 225.52 (* 1 = 225.52 loss)
I0302 19:13:27.423842 31026 solver.cpp:244] Train net output #4: dsn5_loss = 224.127 (* 1 = 224.127 loss)
I0302 19:13:27.423864 31026 solver.cpp:244] Train net output #5: fuse_loss = 218.551 (* 1 = 218.551 loss)
I0302 19:13:27.423871 31026 sgd_solver.cpp:106] Iteration 6400, lr = 1e-06
I0302 19:13:52.708914 31026 solver.cpp:228] Iteration 6420, loss = 11339.1
I0302 19:13:52.708992 31026 solver.cpp:244] Train net output #0: dsn1_loss = 8.48727 (* 1 = 8.48727 loss)
I0302 19:13:52.709002 31026 solver.cpp:244] Train net output #1: dsn2_loss = 3.91735 (* 1 = 3.91735 loss)
I0302 19:13:52.709007 31026 solver.cpp:244] Train net output #2: dsn3_loss = 3.22385 (* 1 = 3.22385 loss)
I0302 19:13:52.709013 31026 solver.cpp:244] Train net output #3: dsn4_loss = 3.65278 (* 1 = 3.65278 loss)
I0302 19:13:52.709018 31026 solver.cpp:244] Train net output #4: dsn5_loss = 3.51696 (* 1 = 3.51696 loss)
I0302 19:13:52.709024 31026 solver.cpp:244] Train net output #5: fuse_loss = 2.89571 (* 1 = 2.89571 loss)
.........
Is there something wrong?

i did not set loss parameters η and λ .
where should i set these parameters ?
thx

Failed in model= loadcaffe.load('./models/deploy2_cheng.prototxt', './models/rcf_pretrained_bsds.caffemodel', 'nn'):

[libprotobuf ERROR google/protobuf/text_format.cc:274] Error parsing text-format caffe.NetParameter: 54:69: Message type "caffe.ConvolutionParameter" has no field named "dilation".
Successfully loaded ./models/rcf_pretrained_bsds.caffemodel
warning: module 'data [type ImageLabelmapData]' not found
warning: module 'data_data_0_split [type Split]' not found
warning: module 'label_data_1_split [type Split]' not found
warning: module 'conv1_1_relu1_1_0_split [type Split]' not found
warning: module 'conv1_2_relu1_2_0_split [type Split]' not found
warning: module 'conv2_1_relu2_1_0_split [type Split]' not found
warning: module 'conv2_2_relu2_2_0_split [type Split]' not found
warning: module 'conv3_1_relu3_1_0_split [type Split]' not found
warning: module 'conv3_2_relu3_2_0_split [type Split]' not found
warning: module 'conv3_3_relu3_3_0_split [type Split]' not found
warning: module 'conv4_1_relu4_1_0_split [type Split]' not found
warning: module 'conv4_2_relu4_2_0_split [type Split]' not found
warning: module 'conv4_3_relu4_3_0_split [type Split]' not found
warning: module 'conv5_1_relu5_1_0_split [type Split]' not found
warning: module 'conv5_2_relu5_2_0_split [type Split]' not found
warning: module 'score_fuse1 [type Eltwise]' not found
warning: module 'upscore-dsn1_score-dsn1_0_split [type Split]' not found
warning: module 'dsn1_loss [type SigmoidCrossEntropyLoss]' not found
warning: module 'score_fuse2 [type Eltwise]' not found
warning: module 'upsample_2 [type Deconvolution]' not found
warning: module 'crop2 [type AutoCrop]' not found
warning: module 'upscore-dsn2_crop2_0_split [type Split]' not found
warning: module 'dsn2_loss [type SigmoidCrossEntropyLoss]' not found
warning: module 'score_fuse3 [type Eltwise]' not found
warning: module 'upsample_4 [type Deconvolution]' not found
warning: module 'crop3 [type AutoCrop]' not found
warning: module 'upscore-dsn3_crop3_0_split [type Split]' not found
warning: module 'dsn3_loss [type SigmoidCrossEntropyLoss]' not found
warning: module 'score_fuse4 [type Eltwise]' not found
warning: module 'upsample_8 [type Deconvolution]' not found
warning: module 'crop4 [type AutoCrop]' not found
warning: module 'upscore-dsn4_crop4_0_split [type Split]' not found
warning: module 'dsn4_loss [type SigmoidCrossEntropyLoss]' not found
warning: module 'score_fuse5 [type Eltwise]' not found
warning: module 'upsample_8_5 [type Deconvolution]' not found
warning: module 'crop5 [type AutoCrop]' not found
warning: module 'upscore-dsn5_crop5_0_split [type Split]' not found
warning: module 'dsn5_loss [type SigmoidCrossEntropyLoss]' not found
warning: module 'concat [type Concat]' not found
warning: module 'fuse_loss [type SigmoidCrossEntropyLoss]' not found
........

Then when run
local out= model:forward(image_test)
There is error as following
In 31 module of nn.Sequential:
~/torch/install/share/lua/5.1/nn/THNN.lua:110: Need input of dimension 3 and input.size[0] == 64 but got input to be of shape: [512 x 68 x 68] at /tmp/luarocks_cunn-scm-1-5732/cunn/lib/THCUNN/generic/SpatialConvolutionMM.cu:49
stack traceback:

Could you please tell me why?

Many thanks

how to evaluate the result?

I noticed that you released the code to plot edge PR curves. But I wonder how can I get the RCF_bdry.txt and RCF_bdry_thr.txt for my own dataset? And what does every column in the RCF_bdry.txt and the RCF_bdry_thr.txt mean?

about the base model

In your paper, VGG model is used, and how about googlenet? is the architecture influenced by different base model?

Layer conv1_1 has unknown engine.

hi. thanks for your great job.
I got this error when i run RCF-multiscale.ipynb.

I0911 19:19:47.419523 17941 layer_factory.hpp:77] Creating layer input
I0911 19:19:47.419531 17941 net.cpp:101] Creating Layer input
I0911 19:19:47.419535 17941 net.cpp:409] input -> data
I0911 19:19:47.428836 17941 net.cpp:151] Setting up input
I0911 19:19:47.428869 17941 net.cpp:158] Top shape: 1 3 224 224 (150528)
I0911 19:19:47.428874 17941 net.cpp:166] Memory required for data: 602112
I0911 19:19:47.428879 17941 layer_factory.hpp:77] Creating layer data_input_0_split
I0911 19:19:47.428887 17941 net.cpp:101] Creating Layer data_input_0_split
I0911 19:19:47.428890 17941 net.cpp:435] data_input_0_split <- data
I0911 19:19:47.428896 17941 net.cpp:409] data_input_0_split -> data_input_0_split_0
I0911 19:19:47.428903 17941 net.cpp:409] data_input_0_split -> data_input_0_split_1
I0911 19:19:47.428908 17941 net.cpp:409] data_input_0_split -> data_input_0_split_2
I0911 19:19:47.428912 17941 net.cpp:409] data_input_0_split -> data_input_0_split_3
I0911 19:19:47.428917 17941 net.cpp:409] data_input_0_split -> data_input_0_split_4
I0911 19:19:47.428961 17941 net.cpp:151] Setting up data_input_0_split
I0911 19:19:47.428966 17941 net.cpp:158] Top shape: 1 3 224 224 (150528)
I0911 19:19:47.428969 17941 net.cpp:158] Top shape: 1 3 224 224 (150528)
I0911 19:19:47.428972 17941 net.cpp:158] Top shape: 1 3 224 224 (150528)
I0911 19:19:47.428977 17941 net.cpp:158] Top shape: 1 3 224 224 (150528)
I0911 19:19:47.428979 17941 net.cpp:158] Top shape: 1 3 224 224 (150528)
I0911 19:19:47.428982 17941 net.cpp:166] Memory required for data: 3612672
I0911 19:19:47.428983 17941 layer_factory.hpp:77] Creating layer conv1_1
F0911 19:19:47.428990 17941 layer_factory.cpp:69] Layer conv1_1 has unknown engine.
*** Check failure stack trace: ***
Aborted (core dumped)

what's wrong with it? thanks a lot.

train.sh

您好,当我在运行train.sh的时候出现以下错误
I0404 15:24:53.409358 842 layer_factory.hpp:77] Creating layer data
I0404 15:24:53.409374 842 net.cpp:101] Creating Layer data
I0404 15:24:53.409380 842 net.cpp:409] data -> data
I0404 15:24:53.409389 842 net.cpp:409] data -> label
I0404 15:24:53.409402 842 image_labelmap_data_layer.cpp:42] Opening file ../../data/bsds_pascal_train_pair.lst
I0404 15:24:53.409416 842 image_labelmap_data_layer.cpp:52] Shuffling data
I0404 15:24:53.409464 842 image_labelmap_data_layer.cpp:57] A total of 0 images.
./train.sh: line 8: 842 Segmentation fault (core dumped) ./solve.py
请问怎么解决

train.sh

I ran the rcf on ubuntu+python2.7.12. When I ran 'cd $ROOT_DIR/examples/rcf/./train.sh', I got an error like this, what should I do?

aceliu@ubuntu:~/rcf/examples/rcf$ ./train.sh
++ date +%Y-%m-%d_%H-%M-%S

  • LOG=logs/fcn_2017-08-29_04-49-59.txt
  • exec
    ++ tee -a logs/fcn_2017-08-29_04-49-59.txt
  • ./solve.py
    WARNING: Logging before InitGoogleLogging() is written to STDERR
    F0829 04:49:59.729399 63541 common.cpp:66] Cannot use GPU in CPU-only Caffe: check mode.
    *** Check failure stack trace: ***
    ./train.sh: line 8: 63541 Aborted (core dumped) ./solve.py

Unknown layer type: ImageLabelmapData

When I ran the code solve.py, I got the error showed below:

####################################
# More layer-loading info is not shown here
####################################
layer {
  name: "fuse_loss"
  type: "SigmoidCrossEntropyLoss"
  bottom: "upscore-fuse"
  bottom: "label"
  top: "fuse_loss"
  loss_weight: 1
}
I0325 00:01:35.106945 10264 layer_factory.hpp:77] Creating layer data
F0325 00:01:35.106971 10264 layer_factory.hpp:81] Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type: ImageLabelmapData (known types: AbsVal, Accuracy, AnnotatedData, ArgMax, BNLL, BatchNorm, BatchReindex, Bias, Concat, ContrastiveLoss, Convolution, Crop, Data, Deconvolution, DetectionEvaluate, DetectionOutput, Dropout, DummyData, ELU, Eltwise, Embed, EuclideanLoss, Exp, Filter, Flatten, HDF5Data, HDF5Output, HingeLoss, Im2col, ImageData, InfogainLoss, InnerProduct, Input, LRN, Log, MVN, MemoryData, MultiBoxLoss, MultinomialLogisticLoss, Normalize, PReLU, Permute, Pooling, Power, PriorBox, ReLU, Reduction, Reshape, SPP, Scale, Sigmoid, SigmoidCrossEntropyLoss, Silence, Slice, SmoothL1Loss, Softmax, SoftmaxWithLoss, Split, TanH, Threshold, Tile, VideoData, WindowData)
*** Check failure stack trace: ***
/home/ee303/rrc_detection-master/python:~/rrc_detection-master/python/caffe/
Aborted (core dumped)

Caffe: I've adopted caffe built from rrc_detection(similar to the current official one), with USE_CUDNN enabled
Operating system: ubuntu 16.04
Python version: 2.7.11
Cuda version: 9.1.85
cuDNN version: 7.1

So, what would be the problem?

train.sh

I ranthe rcf on ubuntu+python2.7.12. When I ran 'cd $ROOT_DIR/examples/rcf/./train.sh', I got an error like this, what should I do?

aceliu@ubuntu:~/rcf/examples/rcf$ ./train.sh
++ date +%Y-%m-%d_%H-%M-%S

  • LOG=logs/fcn_2017-08-29_04-49-59.txt
  • exec
    ++ tee -a logs/fcn_2017-08-29_04-49-59.txt
  • ./solve.py
    WARNING: Logging before InitGoogleLogging() is written to STDERR
    F0829 04:49:59.729399 63541 common.cpp:66] Cannot use GPU in CPU-only Caffe: check mode.
    *** Check failure stack trace: ***
    ./train.sh: line 8: 63541 Aborted (core dumped) ./solve.py

about the singlescale

你好,我在运行RCF-singlescale.ipynb的时候出现了错误
NameError: name 'time' is not defined
请问怎么解决呀

Can we modify the parameters in edge_nms.m to improve the performance?

I try to modify parameters in edge = edgesNms(edge, O, 2, 5, 1.01, 8), example i change the 1.01 to 1.04 , the final edges become coarser, and the evaluation results improve a little. So, can i adjust these parameters, and then get the best result comparing with other methods in my paper.
Your experiment also change the parameters as follow:
% 2 for BSDS500 and Multi-cue datasets, 4 for NYUD dataset
edge = edgesNms(edge, O, 2, 5, 1.01, 8);

about test stage

In the train_val.prototxt, i find there is not real online testing, and i want to know when to stop training, just by loss? if so, i think it is hard to identify.

It's so slow to train the default dataset "bsds_pascal_train_pair.lst". Is it normal?

It takes 42 hours to finish 520 iterations. My GPU is TITAN Xp. I'm afraid that it didn't use GPU. The solver.prototxt is as follows:
net: "train_val.prototxt"
test_iter: 0
test_interval: 20
%# lr for fine-tuning should be lower than when starting from scratch
base_lr: 1e-6
lr_policy: "step"
gamma: 0.1
iter_size: 10
%# stepsize should also be lower, as we're closer to being done
stepsize: 10000
display: 20
average_loss: 50
max_iter: 1000
momentum: 0.9
weight_decay: 0.0002
snapshot: 1000
snapshot_prefix: "snapshots/rcf_bsds"
%# uncomment the following to default to CPU mode solving
%# solver_mode: CPU

Need deploy pototxt file

hi,

Can you please update Deply_main.prototxt file?

I need that file to convert this caffe model to CoreML model.

Please share that file

about the NYUD result

Hi YunLiu,
I use the provided model and the HHA images you provided to test depth model and rgb model and fuse result, however i only got 0.687 0.700 on depth, the RGB only have 0.695, 0.715 and 0.6195,0.6373 for fusing, and far worst than the report, why this? could any one help? Thanks a lot.

some questions about the RCF-singlescale-NYUD.ipynb

您好,我在运行RCF-singlescale-NYUD.ipynb的时候出现了如下的错误
F0328 15:11:45.498394 2795 syncedmem.hpp:25] Check failed: *ptr host allocation of size 548352000 failed
*** Check failure stack trace: ***
[I 15:11:47.523 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
kernel 18c9976f-ed6a-4422-955b-ba8476373af3 restarted
请问怎么解决呀

About training on GT

I want to use my own data to make a fine-tuning training. I found the ground truth of HED-BSDS, the edge image contains different gray values. I wonder all the edge with different gray value will be use for training? Or just the brightest edges are used for training ?

Can I run the codes in Windows?

Excuse me.I want to run the codes in Windows,is it OK?When I try the testing RCF,the third step is: build caffe. I have already built caffe in Windows system previously.But when I run the RCF-singlescale.ipynb,it failed :ImportError: No module named _caffe. How can I fix it? So sorry to ask for you,thank you very much for reading.

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.