Comments (17)
I have trained it however I get the following error:
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn
from convcrf.
ConvCRFs can be trained using PyTorch. Training is straight forward and can be done like any other neural network. Iterate over the training data, apply softmax cross-entropy loss and use the pytorch autograd package to backprop.
I strongly recommend that you implement your own pipeline. Having a good understanding of your training process is quite crucial in deep learning.
I am considering to make my pipeline public, however the code is currently quite messy, undocumented and will not work out of the box. I think implementing your own pipeline by following some of the pytorch tutorials is much more rewarding and easiert then trying to make mine work.
Edit: I deleted part of my earlier response to increase my overall niceness. You can find the full response in the changelog.
from convcrf.
Thanks for your detailed response. I appreciate it, and I agree with you. I will implement my own pipeline according to your paper and my task.
from convcrf.
Hi Marvin,
I wrote a script to train the convCRF using nll loss. I treat the air plane image as a two class segmentation problem. At the beginning the training went well, the segmentation was improving, but if I keep train it, it would not converge. It reaches the min loss value then the loss stated to increase and the segmentation become worse. Finally, the result become look like the noisy unary. Could you give me some suggestions on what problem this could be? Thank you very much!
Hai
from convcrf.
Hi Hai,
may I ask you why have you used the nll loss and not the cross entropy loss in the training?
Thanks
from convcrf.
Hi prio1988,
I think nll loss is actually multiclass cross entropy, right? It should also work when I set the model to work on only two classes, that is background and foreground. Right?
from convcrf.
Nll loss assume that you have already applied a logSoftMax layer on the top of your network. The multi class cross entropy loss is the torch.nn.CrossEntropyLoss. I think that probably you should use the last one. Instead I am still wondering why to apply a logsoftmax on the unary instead that just a softmax.
from convcrf.
from convcrf.
If you use the crossEntropyLoss you can avoid also the softmax. It is done internally by the loss.
from convcrf.
from convcrf.
Is there any one having tried training?
from convcrf.
I have trained it however I get the following error:
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn
I have the same problem. Have you solved it?
from convcrf.
@HqWei @qiqihaer Could you share a portion of your code for training convCRF?
from convcrf.
from convcrf.
@SHMCU It's very helpful. Thank you very much!
from convcrf.
@SHMCU It's very helpful. Thank you very much!
Hi, did you solve the in-place operation problem?
Should we set CRF iteration step to 1 to avoid this error? I tried it on PACCRF and the same problem occured.
from convcrf.
ConvCRFs can be trained using PyTorch. Training is straight forward and can be done like any other neural network. Iterate over the training data, apply softmax cross-entropy loss and use the pytorch autograd package to backprop.
I strongly recommend that you implement your own pipeline. Having a good understanding of your training process is quite crucial in deep learning.
I am considering to make my pipeline public, however the code is currently quite messy, undocumented and will not work out of the box. I think implementing your own pipeline by following some of the pytorch tutorials is much more rewarding and easiert then trying to make mine work.
Edit: I deleted part of my earlier response to increase my overall niceness. You can find the full response in the changelog.
Hi, I have a question about the training step with this wonderful CRF impletement.
Should we set CRF iteration step=1 in training step ? And in inference step to set it bigger than 1?
from convcrf.
Related Issues (20)
- Why log on input data? HOT 1
- The condition is always False HOT 1
- On the difference compared to the original paper
- Why input is image rather than network output prediction?
- How to use the ConvCRF for depth estimation
- The size of tensor a (512) must match the size of tensor b (20) at non-singleton dimension 1
- The meaning of these parameters? HOT 1
- typeerror HOT 3
- Can I use ConvCRF in grayscale images?
- about the fullcrf training? HOT 1
- Any plan for the tensorflow implementation?
- Where do you implement the compatibility transform? HOT 1
- Another Question about speed test and GPU-memory test HOT 1
- Question about comparative experiment
- About training in deep network.
- Confusion regarding ordering of log and softmax in inference code
- RuntimeError: non-empty 3D or 4D (batch mode) tensor expected for input
- Sir ,tks for the cpu version,however,i think there have some small problems in your code
- KeyError: 'final_softmax'
- About End-to-end training HOT 2
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 convcrf.