Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning for dataloader incompatable upgrade #32967

Conversation

heavengate
Copy link
Contributor

@heavengate heavengate commented May 18, 2021

PR types

Others

PR changes

APIs

Describe

Add warning for DataLoader output data format incompatable upgrade when dataset only contains single filed.

屏幕快照 2021-05-18 下午7 27 39

test code:

import numpy as np
import paddle
from paddle.io import DataLoader, Dataset

class RandomDataset(Dataset):
    def __getitem__(self, idx):
        return np.random.random((2, 3)).astype('float32')

    def __len__(self):
        return 10

dataset = RandomDataset()
loader = DataLoader(dataset, batch_size=1)
for data in loader():
    print(data)

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

from collections.abc import Sequence
except:
from collections import Sequence

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python2 和 python 3.5都已经drop了,这里可以不需要再顾忌collections.abc了吧。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks!

@CLAassistant
Copy link

CLAassistant commented May 19, 2021

CLA assistant check
All committers have signed the CLA.

@heavengate heavengate force-pushed the add_warning_for_dataloader_incompatable_upgrade branch from 3f34bbc to dffb9b8 Compare May 19, 2021 03:06
@paddle-bot-old
Copy link

Sorry to inform you that 1e89504's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

Copy link
Contributor

@chenwhql chenwhql left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@heavengate heavengate merged commit 308467c into PaddlePaddle:develop Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants