kyegomez / Med-PaLM

Towards Generalist Biomedical AI
https://discord.gg/qUtxnK2NMf
MIT License
283 stars 41 forks source link

AssertionError: attention layers must be an Encoder #7

Closed GrishTad closed 11 months ago

GrishTad commented 11 months ago

In Google Colab I am getting an "AssertionError: attention layers must be an Encoder"

[<ipython-input-3-523e80a0ae10>](https://localhost:8080/#) in <cell line: 8>()
      6 caption_tokens = torch.randint(0, 4,(4,4))
      7 
----> 8 model = MedPalm()
      9 output = model(img, caption_tokens)

1 frames
[/usr/local/lib/python3.10/dist-packages/medpalm/core/transformer.py](https://localhost:8080/#) in __init__(self, image_size, patch_size, attn_layers, channels, num_classes, dropout, post_emb_norm, emb_dropout)
   1218     ):
   1219         super().__init__()
-> 1220         assert isinstance(attn_layers, Encoder), 'attention layers must be an Encoder'
   1221         assert image_size % patch_size == 0, 'Image dimensions must be divisible by the patch size'
   1222         dim = attn_layers.dim
ricktop123 commented 11 months ago

1220 assert isinstance(attn_layers, Encoder), 'attention layers must be an Encoder' the same problem, how to fix it?

kyegomez commented 11 months ago

@GrishTad @ricktop123 Please forgive me, it was a small error I have fixed it now

Cartooninspector commented 6 months ago

why don't you share?