Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transformer_encoder library link #3

Open
EmreOzkose opened this issue Jul 4, 2024 · 0 comments
Open

transformer_encoder library link #3

EmreOzkose opened this issue Jul 4, 2024 · 0 comments

Comments

@EmreOzkose
Copy link

Hi,

Can you share how to install "transformer_encoder" ? I just use "pip install transformer_encoder", but got this error:

...
self.visual_transformer = TransformerEncoder(d_model=VISUAL_DIM, 
TypeError: __init__() got an unexpected keyword argument 'num_layers' 

Problem is here:
image

I think these lines should be like that:
image

Although problem is solved, I got this:

Training Iteration:   0%|                                                                                                                                        | 0/448 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "path/to/maf/MAF/Code/Trimodal-BART-driver.py", line 1359, in <module>
    train(model=MODEL,
  File "path/to/maf/MAF/Code/Trimodal-BART-driver.py", line 1239, in train
    train_loss = train_epoch(model,
  File "path/to/maf/MAF/Code/Trimodal-BART-driver.py", line 1044, in train_epoch
    outputs = model(input_ids=input_ids,
  File "path/to/miniconda3/envs/maf/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "path/to/maf/MAF/Code/Trimodal-BART-driver.py", line 667, in forward
    outputs = self.model(
  File "path/to/miniconda3/envs/maf/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "path/to/maf/MAF/Code/Trimodal-BART-driver.py", line 541, in forward
    encoder_outputs = self.encoder(
  File "path/to/miniconda3/envs/maf/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "path/to/maf/MAF/Code/Trimodal-BART-driver.py", line 424, in forward
    acoustic_input = self.acoustic_transformer(acoustic_input)[-1]
  File "path/to/miniconda3/envs/maf/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
TypeError: forward() missing 1 required positional argument: 'mask'

Problem is:

image

I think https://github.com/guocheng18/Transformer-Encoder is not the expected library?

@EmreOzkose EmreOzkose changed the title transformer_encoder transformer_encoder library link Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant