hayeong0 / Diff-HierVC

Official Pytorch Implementation of "Diff-HierVC: Diffusion-based Hierarchical Voice Conversion with Robust Pitch Generation and Masked Prior for Zero-shot Speaker Adaptation"
https://diff-hiervc.github.io/
167 stars 17 forks source link

Getting 'Hparams' has no attribute 'hidden_size' when running infer.sh #8

Closed Guruprasad68 closed 5 days ago

Guruprasad68 commented 6 days ago

Hi, I am getting the following error when I ran infer.sh with the biggan Vocoder. I am not pasting the full traceback as it contains some sensitive paths. My python version is 3.10 and I didn't follow the same versions as given in the requirements.txt file as there were issues in installing natten with the version of pytorch given in that file. So I used 2.0.0 pytorch along with natten 0.17.1 . It will be great if you guys can add what python version you are using to run the model and a full package list with requisite dependencies.

  File "<pathto>/Diff-HierVC/model/diffhiervc.py", line 133, in __init__
    self.encoder = SynthesizerTrn(hps.model.hidden_size)
AttributeError: 'HParams' object has no attribute 'hidden_size' 
hayeong0 commented 6 days ago

Hello, sorry for the confusion. The package you mentioned is not used in the code from this repository. Also, I have changed the variable name from encoder_hidden_size to hidden_size while updating the entire forward code. This change has also been reflected in the config. (ckpt/config.json)

Thanks.

Guruprasad68 commented 6 days ago

Thanks for the update. The requirements.txt file has 'natten==0.14.6'

Guruprasad68 commented 6 days ago

I pulled the latest code and ran infer.sh again. Getting this error now.

RuntimeError: expand(CUDABoolType{[1, 1, 1, 864]}, size=[1, 1, 864]): the number of sizes provided (3) must be greater or equal to the number of dimensions in the tensor (4)
hayeong0 commented 6 days ago

Oh my mistake, I corrected it!

Guruprasad68 commented 5 days ago

Thanks a lot for the changes. It works now