Comments (9)
Quick update. Found the issue. There is a bug in layers.py:
In pixel_wise_softmax_2 and pixel_wise_softmax
If the output_map is too large, then exponential_map goes to infinity, which causes nan when calculating the cost function.
The following code fixes it, although we might want to find a better value to do the clipping:
replace:
exponential_map = tf.exp(output_map)
with:
exponential_map = tf.exp(tf.clip_by_value(output_map, -np.inf, 50))
BTW thanks for providing the tf_unet code. It has been very helpful! :)
from tf_unet.
The error gets hit only after some number of iterations. It seems to get hit after fewer iterations I use the adam optimizer rather than the momentum, but that might just be for my specific case. After enough iterations, I get this error regardless of the optimizer I use. The same training/testing data works fine if I use cross entropy as the cost function.
from tf_unet.
Thanks for reporting this. I'm just wondering why the output_map gets so large
from tf_unet.
Yeah I'm wondering the same thing. I just noticed that I still get garbage results when training my data. (with cross entropy I was getting something more reasonable).
I have no idea why the output_map gets so large, I plan on looking into it some more a little later. Would you happen to have any ideas or theories to look into?
from tf_unet.
I have also encountered this issue.
Using smaller learning rate helped.
So maybe it's just an exploding gradient.
from tf_unet.
Maybe. Another thing I noticed was that to calculate the dice-coefficient, the original code is using both the channels together. When I use only one of the channels, the values I end up getting worked up to be better.
from tf_unet.
This is a typical issue of overflow/underflow when computing the sum (exp (x)) function. Search 'log sum exp' on the web will give some explanation. The trick is to divide/multiply the same constant before exp function.
Or you can use tf.reduce_logsumexp
or refer to source code of this function.
from tf_unet.
@weiliu620 thanks for the hint. I'm going to look into this
from tf_unet.
@weiliu620 following the lines from here refered in your SO question we would just have to subtract the result of tf.reduce_max
in the tf.exp
call, right?
from tf_unet.
Related Issues (20)
- How to use nii.gz image format in my own dataset?
- Cannot access the folder of checkpoints to predict.
- 2 class segmentation prediction values don't range from [0, 1] HOT 1
- converting to ONNX, need names of input and output nodes. HOT 1
- black screen regarding the predictor for demo_toy_problem Notebook HOT 1
- how i can use method "evaluate", to get a accuracy and precision of the neural network ? HOT 1
- Why my .meta file is growing bigger while training? HOT 1
- How to train data HOT 1
- Training Accuracy is always 1.00 and the Minibatch error is always 0.0% HOT 3
- what is the difference between jaccard similarity and Intersection over union ?
- how to detect galaxies and star in wide field imaging data. HOT 2
- Issues with import: Colab HOT 1
- How to get the requirement.txt? HOT 1
- Could you share your data set?
- TypeError: Fetch argument None has invalid type <class 'NoneType'>
- TypeError: Fetch argument None has invalid type <class 'NoneType'>
- TypeError: Fetch argument None has invalid type <class 'NoneType'> HOT 1
- ConcatOp error when changing layer_depth=3 to a larger value in circle demo. HOT 1
- UnsupportedPluginTypeException: Coordinate frame barycentricmeanecliptic not in allowed values
- Install tf_unet
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 tf_unet.