amirbar / visual_prompting

Official implementation and data release of the paper "Visual Prompting via Image Inpainting".
https://yossigandelsman.github.io/visual_prompt
294 stars 20 forks source link

raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'Block' object has no attribute 'drop_path' #2

Open senlin-ali opened 1 year ago

senlin-ali commented 1 year ago

raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'Block' object has no attribute 'drop_path'

senlin-ali commented 1 year ago

using demo.ipynb with provided weights

vishaal27 commented 1 year ago

There's a small bug in the inference script. Change lines 202-205 in evaluate/mae_utils.py to:

# Here we continue to the orignal block.
x = x + blk.drop_path1(x_temp)

x = x + blk.drop_path2(blk.mlp(blk.norm2(x)))

The keys in the model dict for the transformer decoder blocks are slightly different when loaded from the original checkpoint. It should work after this fix.