MiguelMonteiro / CRFasRNNLayer

Conditional Random Fields as Recurrent Neural Networks (Tensorflow)
MIT License
82 stars 20 forks source link

batchsize problem when training with FCN #2

Open yoyoleeisstrong opened 6 years ago

yoyoleeisstrong commented 6 years ago

If I combine FCN with your crfasrnn, there is a problem. In crf_rnn_layer.py, 44 column, all_ones = np.ones(unaries_shape, dtype=np.float32), because there is no definite batchzie in model defining process, the batchsize of unaries is None. The error is TypeError: index returned non-int (type NoneType.

Can you give some training examples using your crfasrnn? Thanks!

MiguelMonteiro commented 6 years ago

For now this is intended behaviour, I don't know how to deal with undefined shapes in c++. You can try to force define the shape of the inputs before the crf as rnn layer for it work. I don't have any training examples, it should be somewhat straight-forward to place it on top of a fully-connected neural network, just note the sensitivity to the theta parameters.

yoyoleeisstrong commented 6 years ago

Thanks for your reply. Placing CRFasRNN on top of a fully-connected neural network means CRFasRNN only work for classification? Can CRFasRNN work for image segmentation?

Sincerely, Youyou

2018-06-14 23:45 GMT+08:00 MiguelMonteiro notifications@github.com:

For now this is intended behaviour, I don't know how to deal with undefined shapes in c++. You can try to force define the shape of the inputs before the crf as rnn layer for it work. I don't have any training examples, it should be somewhat straight-forward to place it on top of a fully-connected neural network, just note the sensitivity to the theta parameters.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MiguelMonteiro/CRFasRNNLayer/issues/2#issuecomment-397342667, or mute the thread https://github.com/notifications/unsubscribe-auth/AIDbu9ah6_jkxDoSUZIS0P3ow01wBSC8ks5t8oT_gaJpZM4UoF3I .

-- Youyou Li Ph. D Candidate School of Resources and Environment The University of Electronic Engineering and Science of China email. LiYouyou@std.uestc.edu.cn Tel. +86 13808012140

MiguelMonteiro commented 6 years ago

It will only work for segmentation. I think you should read this paper before deciding if this is appropriate for your use-case.

yoyoleeisstrong commented 6 years ago

Thanks!I will do that.

发自我的 iPhone

在 2018年6月15日,下午4:03,MiguelMonteiro notifications@github.com 写道:

It will only work for segmentation. I think you should read this paper before deciding if this is appropriate for your use-case.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

watchmexiang commented 5 years ago

Hello, may I ask if you have implemented CRFasRNNLayer in FCN, how is it implemented? Thank you. @yoyoleeisstrong @MiguelMonteiro