Code Monkey home page Code Monkey logo

Comments (9)

vonclites avatar vonclites commented on June 16, 2024

Ahhh, my first guess is this is due to how epochs are calculated combined with how the looping over the data is done. When you use a batch size of 1, the # of epochs are perfectly calculated to run over exactly all your data once. However with a batch size > 1, then the number of epochs is the ceiling of dividing the size of your training set by the batch size. For example, with 42 test samples and a batch size of 5, the number of epochs would be ceil(42 / 5) = 9. But 9 * 5 is 45 samples, so you'd be evaluating 3 test samples twice....

It's a lazy way to calculate epochs and do the looping...
Really, the evaluation_loop should make better use of the batch queue (by setting allow_smaller_final_batch=True).

Glad you are making use of the model though! Just beware... this was quickly put together for a class homework and definitely is not polished.

from squeezenet.

aazout avatar aazout commented on June 16, 2024

Thanks! Evaluation loop aside, if I load the checkpoint train model directly and run inference directly, the logit outputs are wildly different for various batch sizes with same input. Just wondering why that would be?

Yes thanks was just playing around with squeezenet.

from squeezenet.

aazout avatar aazout commented on June 16, 2024

Hey, so it seems the issue is that batch_norm needs to be set to is_training=False during inference. You can do this by adjusting your squeezenet model as such:

def squeezenet_arg_scope(is_training=True): batch_norm_params = {'is_training': is_training, 'decay': 0.9, 'updates_collections': None} with slim.arg_scope([slim.conv2d], normalizer_fn=slim.batch_norm, normalizer_params=batch_norm_params) as sc: return sc

from squeezenet.

vonclites avatar vonclites commented on June 16, 2024

Ohhh... woops! Good call, thank you!

from squeezenet.

vonclites avatar vonclites commented on June 16, 2024

Finally had some time to include your fix. Thanks again.

from squeezenet.

Bhagyoday-Patil avatar Bhagyoday-Patil commented on June 16, 2024

Hi @levelvc @vonclites
I have followed similar steps
Converting my images to TFrecords and then trying to use the train_squeezenet script for the same
When i do the same I am getting the below log.txt error

log.txt

Please let me know what exactly is wrong and the workaround for it

Thanks

from squeezenet.

aazout avatar aazout commented on June 16, 2024

from squeezenet.

Bhagyoday-Patil avatar Bhagyoday-Patil commented on June 16, 2024

Looks like your batch size is zero.

On Oct 30, 2018, at 5:16 AM, Bhagyoday-Patil @.***> wrote: Hi @levelvc @vonclites I have followed similar steps Converting my images to TFrecords and then trying to use the train_squeezenet script for the same When i do the same I am getting the below log.txt error log.txt Please let me know what exactly is wrong and the workaround for it Thanks — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

Sorry @levelvc slight mistake
Please find attachment logs.
logs.txt

I have used https://github.com/kwotsin/create_tfrecords to convert my images to tfrecords.
The same tfrecords when given as input to the train_squeezenet script is throwing that error. I have only 2 classes. I am not understanding what exactly is wrong. I have not made any changes in any of the scripts.
tensorflow version = 1.11.0
ubuntu version = 16.04.3
no GPU/CUDA

from squeezenet.

Bhagyoday-Patil avatar Bhagyoday-Patil commented on June 16, 2024

@vonclites @muthiyanbhushan Can you please help me with this error.
As descried above I am getting this error.
PFA log_1.7.1.txt

from squeezenet.

Related Issues (13)

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.