donut
donut copied to clipboard
SwinTransformer' object has no attribute 'pos_drop'
SwinTransformer' object has no attribute 'pos_drop', getting this error in line no 100 in model.py
@Sridhar-Ranganaboina which timm
's version are you using?
pos_drop
was removed since version after 0.6.13
You can either pip install timm==0.6.13
or comment the line x = self.model.pos_drop(x)
in the function SwinEncoder.forward(...)
(in the file donut/model.py
).
For more information:
In SwinTransformer (timm==0.6.13), pos_drop
is defined as a Dropout self.pos_drop = nn.Dropout(p=drop_rate)
In addition, Donut
uses SwinTransformer
without declaring drop_rate
so drop_rate=0.
by default,
https://github.com/clovaai/donut/blob/a0e94bf145d81cfc934eae8848f1269ae9ca46a2/donut/model.py#L63-L71
which means you can safely ignore the line x = self.model.pos_drop(x)
.
Sorry, for the noise. this does indeed work!
@Sridhar-Ranganaboina which
timm
's version are you using?pos_drop
was removed since version after0.6.13
You can eitherpip install timm==0.6.13
or comment the linex = self.model.pos_drop(x)
in the functionSwinEncoder.forward(...)
(in the filedonut/model.py
).For more information: In SwinTransformer (timm==0.6.13),
pos_drop
is defined as a Dropoutself.pos_drop = nn.Dropout(p=drop_rate)
In addition,Donut
usesSwinTransformer
without declaringdrop_rate
sodrop_rate=0.
by default,https://github.com/clovaai/donut/blob/a0e94bf145d81cfc934eae8848f1269ae9ca46a2/donut/model.py#L63-L71
which means you can safely ignore the line
x = self.model.pos_drop(x)
.
Well, it solved this issue but generates the following error : BARTDecoder.prepare_inputs_for_inference() got an unexpected keyword argument 'past_key_values'