[go: nahoru, domu]

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

Why do you need custom Features? #441

Open
gordon-lim opened this issue Jun 19, 2024 · 1 comment
Open

Why do you need custom Features? #441

gordon-lim opened this issue Jun 19, 2024 · 1 comment

Comments

@gordon-lim
Copy link

Why do we need the following in the Fine-tuning LayoutLMv2ForSequenceClassification on RVL-CDIP notebook?

# we need to define custom features
features = Features({
    'image': Array3D(dtype="int64", shape=(3, 224, 224)),
    'input_ids': Sequence(feature=Value(dtype='int64')),
    'attention_mask': Sequence(Value(dtype='int64')),
    'token_type_ids': Sequence(Value(dtype='int64')),
    'bbox': Array2D(dtype="int64", shape=(512, 4)),
    'labels': ClassLabel(num_classes=len(labels), names=labels),
})
@NielsRogge
Copy link
Owner

Hi,

I should actually update this notebook as now we can use the native Image feature rather than Array3D for the image column. Did you try to run the code without defining custom features, and if so, did it work?

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

No branches or pull requests

2 participants