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

Colab: TransformerEncoderRPR.forward() got an unexpected keyword argument 'is_causal' #5

Open
drscotthawley opened this issue Nov 22, 2023 · 2 comments

Comments

@drscotthawley
Copy link

drscotthawley commented Nov 22, 2023

Hi! Thanks for sharing your code! I was running your SuperPiano_3 Colab and got all the way to the where we "Start to Train the Model" (I was using MAESTRO), but ended up with an unexpected kwarg error:

=========================
input_dir: ./dataset/e_piano
output_dir: rpr
weight_modulus: 1
print_modulus: 1

n_workers: 1
force_cpu: False
tensorboard: True

continue_weights: None
continue_epoch: None

lr: None
ce_smoothing: None
batch_size: 4
epochs: 150

rpr: True
max_sequence: 2048
n_layers: 6
num_heads: 8
d_model: 512

dim_feedforward: 1024
dropout: 0.1
=========================

2023-11-22 01:46:35.726273: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2023-11-22 01:46:35.726329: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2023-11-22 01:46:35.726365: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2023-11-22 01:46:37.157198: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
=========================
Baseline model evaluation (Epoch 0):
Traceback (most recent call last):
  File "/content/MusicTransformer-Pytorch/train.py", line 218, in <module>
    main()
  File "/content/MusicTransformer-Pytorch/train.py", line 155, in main
    train_loss, train_acc = eval_model(model, train_loader, train_loss_func)
  File "/content/MusicTransformer-Pytorch/utilities/run_model.py", line 81, in eval_model
    y = model(x)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
  File "/content/MusicTransformer-Pytorch/model/music_transformer.py", line 101, in forward
    x_out = self.transformer(src=x, tgt=x, src_mask=mask)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/transformer.py", line 204, in forward
    memory = self.encoder(src, mask=src_mask, src_key_padding_mask=src_key_padding_mask,
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
TypeError: TransformerEncoderRPR.forward() got an unexpected keyword argument 'is_causal'

I wonder how that might be fixed?

@Sunwood-ai-labs
Copy link

I got it working with below command

!pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchtext==0.14.1 torchaudio==0.13.1 torchdata==0.5.1 --extra-index-url https://download.pytorch.org/whl/cu117

@asigalov61
Copy link
Owner

@drscotthawley @Sunwood-ai-labs

Thank you for your interest and for bug reports.

This repo had been depreciated long time ago so some stuff may not work right.

Please refer to https://github.com/asigalov61/asigalov61 for the list of current/supported projects.

Thank you.

Alex.

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

3 participants