Comments (3)
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.
data loader have been extended to available to using target transform.
return value of dataloader's get item is image,target. target is [cls_name,[xmin, ymin, xmax, ymax]]
but i face on other error.
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.
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)
- Loss function HOT 1
- Any plans to support Wandb Hyperparameter Searching?
- Strange bugs occur when the number of Gpus trained and tested is inconsistent
- usage of shuffle=True when using SubsetRandomSampler HOT 1
- TODO: also configure logging for sub-processes(not master) HOT 4
- DataLoader example
- python train.py --resume path/to/checkpoint HOT 1
- Save best model HOT 1
- Model is moved to GPU after the optimizer is instatiated, resulting in a performance hit. HOT 4
- Setting 'early_stop: 0' does not disable it HOT 2
- Passing an iterable from config.json HOT 2
- Add custom flag & override from CLI HOT 1
- Some features I have implemented.
- ReduceLROnPlateau lr_scheduler HOT 3
- Only `data_loader.data_loaders` is plural HOT 5
- Any support for multiple loss functions? HOT 5
- Latest checkpoint HOT 8
- Some thing wrong with add_histogram function HOT 2
- Adding mesh to Tensorboard not working via TensorboardWriter HOT 2
- Any plans to support DistributedDataParallel? HOT 2
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 pytorch-template.