Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Transforms are not compatible with DownloadedDatasets #11141

Closed
ShownX opened this issue Jun 4, 2018 · 3 comments · Fixed by #17852
Closed

Transforms are not compatible with DownloadedDatasets #11141

ShownX opened this issue Jun 4, 2018 · 3 comments · Fixed by #17852

Comments

@ShownX
Copy link

ShownX commented Jun 4, 2018

Note: Providing complete information in the most concise form is the best way to get help. This issue template serves as the checklist for essential information to most of the technical issues and bug reports. For non-technical issues and feature requests, feel free to present the information in what you believe is the best form.

For Q & A and discussion, please start a discussion thread at https://discuss.mxnet.io

Description

Transforms are not compatible with _DownloadedDatasets such as MNIST

Environment info (Required)

MAC and Ubuntu 16.04

What to do:
1. Download the diagnosis script from https://raw.githubusercontent.com/apache/incubator-mxnet/master/tools/diagnose.py
2. Run the script using `python diagnose.py` and paste its output here.

Package used (Python/R/Scala/Julia):
(I'm using Python)

Error Message:

TypeError: forward() takes 2 positional arguments but 3 were given

Minimum reproducible example

from mxnet.gluon.data import Dataloader
from mxnet.gluon.vision import transforms, MNIST

ds = MNIST(train=True, transform=transforms.ToTensor)
dl = DataLoader(ds, 10, shuffle=True)

What have you tried to solve it?

the transforms function take one data as input but _DownloadDatasets use datasets and labels as input L201

Also, checked the ImageRecordDataset, it consists with _DownloadedDatasets.
Suggest to change the transform API to forward(F, x, y)

@piiswrong
Copy link
Contributor

It's not supposed to work that way. You need to use a lambda

@ShownX
Copy link
Author

ShownX commented Jun 4, 2018

Hmm..., I do not think it is a good idea to use lambda or another function to do the data augmentation since there are transform functions. Can I ask what is the reason to keep difference? I think the customer would get confused and frustrated when using this features.

@szha
Copy link
Member

szha commented Jun 4, 2018

I labeled the issue this way as I think we should eventually get rid of the redundant transform argument in datasets.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants