NielsRogge / Transformers-Tutorials

This repository contains demos I made with the Transformers library by HuggingFace.
MIT License
9.16k stars 1.42k forks source link

AttributeError: 'ViltImageProcessor' object has no attribute 'pad_and_create_pixel_mask' #335

Closed CarolineGao closed 1 year ago

CarolineGao commented 1 year ago

When using the Fine-tuning ViLT for VQA.ipynb jupyternotebook, follow the steps, but cannot pass this code: encoding = processor.feature_extractor.pad_and_create_pixel_mask(pixel_values, return_tensors="pt").

It says AttributeError: 'ViltImageProcessor' object has no attribute 'pad_and_create_pixel_mask'

NielsRogge commented 1 year ago

It seems that this method was updated to be just called pad now, apologies for the breaking change.

cc @amyeroberts

NielsRogge commented 1 year ago

I've updated the notebook, should work now. Thanks for reporting!