Skip to content

transformer_encoder library link #3

@EmreOzkose

Description

@EmreOzkose

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions