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

AttributeError: 'tuple' object has no attribute 'transpose' #49

Open
ashutoshbk opened this issue Aug 1, 2023 · 4 comments
Open

AttributeError: 'tuple' object has no attribute 'transpose' #49

ashutoshbk opened this issue Aug 1, 2023 · 4 comments

Comments

@ashutoshbk
Copy link

ashutoshbk commented Aug 1, 2023

when running, !sh scripts/demo.sh vocaset

Some weights of Wav2Vec2Model were not initialized from the model checkpoint at facebook/wav2vec2-base-960h and are newly initialized: ['wav2vec2.masked_spec_embed']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
=> loading checkpoint 'vocaset/vocaset_stage2.pth.tar'
=> loaded checkpoint 'vocaset/vocaset_stage2.pth.tar'
Generating facial animation for demo/wav/man.wav...
2023-08-01 13:21:18.492516: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
  File "/content/CodeTalker/main/demo.py", line 219, in <module>
    main()
  File "/content/CodeTalker/main/demo.py", line 129, in main
    test(model, cfg.demo_wav_path, save_folder, condition, subject)
  File "/content/CodeTalker/main/demo.py", line 167, in test
    prediction = model.predict(audio_feature, template, one_hot)
  File "/content/CodeTalker/models/stage2.py", line 115, in predict
    hidden_states = self.audio_encoder(audio, self.dataset).last_hidden_state
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/content/CodeTalker/models/lib/wav2vec.py", line 132, in forward
    encoder_outputs = self.encoder(
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/transformers/models/wav2vec2/modeling_wav2vec2.py", line 788, in forward
    position_embeddings = self.pos_conv_embed(hidden_states)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/transformers/models/wav2vec2/modeling_wav2vec2.py", line 397, in forward
    hidden_states = hidden_states.transpose(1, 2)
AttributeError: 'tuple' object has no attribute 'transpose'
@Doubiiu
Copy link
Owner

Doubiiu commented Aug 1, 2023

Hi, please make sure the package version is correct following the requirements.txt. I think transformers==4.6.1 can solve this problem.

@Doubiiu Doubiiu closed this as completed Aug 5, 2023
@ashutoshbk
Copy link
Author

hey, it is transformers==4.6.1. Actually i am running demo colab notebook provided by you. I am running without changing anything still same error.

@Doubiiu Doubiiu reopened this Aug 7, 2023
@Utkarsh-shift
Copy link

same issue

1 similar comment
@mmxuan18
Copy link

mmxuan18 commented Jun 6, 2024

same issue

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

4 participants