Code Monkey home page Code Monkey logo

Comments (4)

timothylimyl avatar timothylimyl commented on July 23, 2024 1

@ynjiun,

if you set the train loader to drop_last=True , you will not face this problem. 16*13=208, leaving one image behind, should not work for 16/13 but should had work for 13.

@VainF ,

I think it will be best if you set the train loader to drop_last=True just in case. Edit line: https://github.com/VainF/DeepLabV3Plus-Pytorch/blob/master/main.py#L236

Currently, pytorch batchnorm for training is not smart enough to ignore single batch size with single value feature map and some user will face this problem if their batch size has a remainder of 1 from the dataset.

For example, building a bigger backbone, I was forced to use batch_size=2 and on cityscapes, the error will pop up as the train set has 2975 images (leaving a remainder of 1 at the last load which causes the error).

from deeplabv3plus-pytorch.

VainF avatar VainF commented on July 23, 2024

Hi @ynjiun, please make sure that batch size>1 for training mode.

from deeplabv3plus-pytorch.

ynjiun avatar ynjiun commented on July 23, 2024

Hi VainF,

Thank you for your response. It turns out that for unknown reason if the batch_size is 16 or 15 or 13, it will report the error. But if I set batch_size 14 or 12, then it works. I don't know why. Any insights?

from deeplabv3plus-pytorch.

VainF avatar VainF commented on July 23, 2024

Fixed! Thanks for your help.

from deeplabv3plus-pytorch.

Related Issues (20)

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.