Showing posts with label histogram. Show all posts
Showing posts with label histogram. Show all posts

Thursday, March 1, 2018

Tensorflow: Softmax cross entropy with logits becomes inf

Leave a Comment

I am working on the Tensorflow for poets tutorial. Most of the time, training fails with an error Nan in summary histogram. I run the following command on the original data to retrain:

python -m scripts.retrain       --bottleneck_dir=tf_files/bottlenecks       --model_dir=tf_files/models/       --summaries_dir=tf_files/training_summaries/"${ARCHITECTURE}"       --output_graph=tf_files/retrained_graph.pb       --output_labels=tf_files/retrained_labels.txt      --image_dir=/ml/data/images 

This error occurred in other mentions as well. I followed the instructions there using tfdg which gave me a bit more insight (see below). However, I am still stuck because I do not know why this happens and what I can do to fix it without much experience in TF and neural networks. This is especially confusing because it happens with 100% tutorial code & data.

Here is the output from tfdg. The first time the error appears:

tfdg output for the node with the error And the node in detail:

enter image description here

To look at the retrain script you can find Google's original code here. It was not modified in my case. Sorry for not including it (too many characters).

1 Answers

Answers 1

Are you sure tf_files folder is being created? I faced some issue on command line python. I switched to spyder and changed the variable data of input as required in retrain.py and it runs smoothly. I know, it's not a solution but a turnaround.

Read More

Saturday, March 12, 2016

Pyramidal Histogram Of Oriented Gradients - Trilinear interpolation

Leave a Comment

Hello im struggling with an implementation of this article: https://goo.gl/8mpIuq

I performed bilinear interpolation over the histogram bins and the results are better with this interpolation, however on page 2 its also mentioned that a trilinear interpolation is added when the pyramid level reaches level 2. I have read this answer HOG Trilinear Interpolation of Histogram Bins and I completely understand the formula behind trilinear interpolation over 2x2 block sizes, but in this article we have a 3x3 block size and 7x7 on pyramid level 3, because these block sizes yield the best results.

The main point about trilinear interpolation is that each pixel in a cell contributes to its local cell by a weight which is defined as the position in each block. I don't know how to represent the location of a pixel in 3x3 block size or what kind of formula should i use.

Thank you for all your help!

EDIT: Another explanation with 2x2 block size http://pep.ijieee.org.in/journal_pdf/11-126-142960909718-22.pdf

0 Answers

Read More