unilm icon indicating copy to clipboard operation
unilm copied to clipboard

got an unexpected keyword argument 'distilled'

Open sssimpleboy opened this issue 2 years ago • 3 comments

Describe the bug Model I am using (UniLM, MiniLM, LayoutLM ...):

The problem arises when using:

  • [ ] the official example scripts: (give details below)
  • [ ] my own modified scripts: (give details below)

A clear and concise description of what the bug is. image image

To Reproduce Steps to reproduce the behavior: 1. 2. 3.

Expected behavior A clear and concise description of what you expected to happen.

  • Platform:
  • Python version:
  • PyTorch version (GPU?):

sssimpleboy avatar Oct 25 '22 02:10 sssimpleboy

image image image

sssimpleboy avatar Oct 25 '22 02:10 sssimpleboy

The parameters distilled and pretrained_cfg are in the **kwargs dict but should not be when it is passed to VisionTransformer's init function.

I added the following right before the super().__init__(*args, **kwargs)

The modified version in the class AdaptedVisionTransformer(VisionTransformer): line now looks like this:

self.distilled = kwargs.pop('distilled')
self.pretrained_cfg = kwargs.pop('pretrained_cfg')
super().__init__(*args, **kwargs)

stevewillson avatar Nov 18 '22 18:11 stevewillson

The parameters distilled and pretrained_cfg are in the **kwargs dict but should not be when it is passed to VisionTransformer's init function.

I added the following right before the super().__init__(*args, **kwargs)

The modified version in the class AdaptedVisionTransformer(VisionTransformer): line now looks like this:

self.distilled = kwargs.pop('distilled')
self.pretrained_cfg = kwargs.pop('pretrained_cfg')
super().__init__(*args, **kwargs)

Thank you.

sssimpleboy avatar Nov 24 '22 07:11 sssimpleboy