Giter Site home page Giter Site logo

Comments (3)

SunQpark avatar SunQpark commented on July 24, 2024

transforms of torchvision are only for images, but you are trying to apply it also on targets(labels).
So, remove , target_transform=trsfm part.

from pytorch-template.

EzoBear avatar EzoBear commented on July 24, 2024

data loader have been extended to available to using target transform.
image
return value of dataloader's get item is image,target. target is [cls_name,[xmin, ymin, xmax, ymax]]
but i face on other error.
image
i think mnist data is gary but voc data is rgb image. so first rank is not same.
mnist is [1,x,y] but voc is [3,x,y]
where should i look??

ps.... when i use torchvision voc dataset loader, i was face on type error.
and sorry for inconveniencing to you.
thank you.

from pytorch-template.

SunQpark avatar SunQpark commented on July 24, 2024

Since dataset only returns single image and target, data_loader calls collate internally to stack them together into a batch. For mnist, image from dataset has size (1, 28, 28) and default functions stacks n images to make (n, 1, 28, 28) batch. But since VOC images have various shape(3, ?, ?) so you should resize or crop images into same size(use transforms.Resize(224), for example).

But sadly, this is not your last error to encounter, since targets also have various size in detection task. All I can say is that you will need to use collate_fn argument to fix that. You'd netter ask Google or Stackoverflow how to do that.

from pytorch-template.

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.