Skip to content

AttributeError: type object 'obj' has no attribute '_attn_implementation' #7781

Open

Description

@KumoLiu
======================================================================
ERROR: test_shape_0 (tests.test_transchex.TestTranschex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/parameterized/parameterized.py", line 620, in standalone_func
    return func(*(a + p.args), **p.kwargs, **kw)
  File "/workspace/Code/MONAI/tests/test_transchex.py", line 53, in test_shape
    net = Transchex(**input_param)
  File "/workspace/Code/MONAI/monai/networks/nets/transchex.py", line 342, in __init__
    self.multimodal = MultiModal.from_pretrained(
  File "/workspace/Code/MONAI/monai/networks/nets/transchex.py", line 69, in from_pretrained
    model = cls(num_language_layers, num_vision_layers, num_mixed_layers, bert_config, *inputs, **kwargs)
  File "/workspace/Code/MONAI/monai/networks/nets/transchex.py", line 223, in __init__
    self.language_encoder = nn.ModuleList([BertLayer(self.config) for _ in range(num_language_layers)])
  File "/workspace/Code/MONAI/monai/networks/nets/transchex.py", line 223, in <listcomp>
    self.language_encoder = nn.ModuleList([BertLayer(self.config) for _ in range(num_language_layers)])
  File "/usr/local/lib/python3.10/dist-packages/transformers/models/bert/modeling_bert.py", line 558, in __init__
    self.attention = BertAttention(config)
  File "/usr/local/lib/python3.10/dist-packages/transformers/models/bert/modeling_bert.py", line 476, in __init__
    self.self = BERT_SELF_ATTENTION_CLASSES[config._attn_implementation](
AttributeError: type object 'obj' has no attribute '_attn_implementation'

======================================================================
ERROR: test_shape_1 (tests.test_transchex.TestTranschex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/parameterized/parameterized.py", line 620, in standalone_func
    return func(*(a + p.args), **p.kwargs, **kw)
  File "/workspace/Code/MONAI/tests/test_transchex.py", line 53, in test_shape
    net = Transchex(**input_param)
  File "/workspace/Code/MONAI/monai/networks/nets/transchex.py", line 342, in __init__
    self.multimodal = MultiModal.from_pretrained(
  File "/workspace/Code/MONAI/monai/networks/nets/transchex.py", line 69, in from_pretrained
    model = cls(num_language_layers, num_vision_layers, num_mixed_layers, bert_config, *inputs, **kwargs)
  File "/workspace/Code/MONAI/monai/networks/nets/transchex.py", line 223, in __init__
    self.language_encoder = nn.ModuleList([BertLayer(self.config) for _ in range(num_language_layers)])
  File "/workspace/Code/MONAI/monai/networks/nets/transchex.py", line 223, in <listcomp>
    self.language_encoder = nn.ModuleList([BertLayer(self.config) for _ in range(num_language_layers)])
  File "/usr/local/lib/python3.10/dist-packages/transformers/models/bert/modeling_bert.py", line 558, in __init__
    self.attention = BertAttention(config)
  File "/usr/local/lib/python3.10/dist-packages/transformers/models/bert/modeling_bert.py", line 476, in __init__
    self.self = BERT_SELF_ATTENTION_CLASSES[config._attn_implementation](
AttributeError: type object 'obj' has no attribute '_attn_implementation'

----------------------------------------------------------------------

Activity

  1. KumoLiu commented on May 18, 2024

    @KumoLiu
    ContributorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions