ctr4si / A-Hierarchical-Latent-Structure-for-Variational-Conversation-Modeling

PyTorch Implementation of "A Hierarchical Latent Structure for Variational Conversation Modeling" (NAACL 2018 Oral)
MIT License
174 stars 45 forks source link

ValueError: expected sequence of length 11 at dim 1 (got 18) #2

Open vnnw opened 6 years ago

vnnw commented 6 years ago

I cloned the repo to run the train.py on dataset ubuntu, both commands gave me similar errors as below

python train.py --data=ubuntu --model=VHRED --batch_size=40 --word_drop=0.25 --kl_annealing_iter=250000
python train.py --data=ubuntu --model=VHCR --batch_size=40 --sentence_drop=0.25 --kl_annealing_iter=250000

Traceback (most recent call last): File "train.py", line 53, in solver.train() File "/home/user/ML/A-Hierarchical-Latent-Structure-for-Variational-Conversation-Modeling-master/model/utils/time_track.py", line 18, in timed result = method(*args, **kwargs) File "/home/user/ML/A-Hierarchical-Latent-Structure-for-Variational-Conversation-Modeling-master/model/solver.py", line 466, in train sentences = to_var(torch.LongTensor(sentences)) ValueError: expected sequence of length 11 at dim 1 (got 18)


But running "python train.py --data=cornell --model=HRED" seems working fine.

I was running with pytorch 0.4.0 which i conda-installed from pytorch channel. 
jverygood commented 6 years ago

Each sentence has a different dimension, which leads to this error(in LongTensor). I don't know how to solve it too

j-min commented 5 years ago

Just found a bug from data preprocessing file and fixed it. => https://github.com/ctr4si/A-Hierarchical-Latent-Structure-for-Variational-Conversation-Modeling/commit/e0d70c5b19ec724dd404ca3c94335417a4722068 Please check if it works now.

zhongchaoze commented 4 years ago

咋个搞吗

jverygood commented 4 years ago

咋个搞吗

作者不是修复了吗