A-Hierarchical-Latent-Structure-for-Variational-Conversation-Modeling icon indicating copy to clipboard operation
A-Hierarchical-Latent-Structure-for-Variational-Conversation-Modeling copied to clipboard

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

Open vnnw opened this issue 6 years ago • 4 comments

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. 

vnnw avatar May 10 '18 08:05 vnnw

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

jverygood avatar Aug 17 '18 09:08 jverygood

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.

j-min avatar Oct 19 '18 02:10 j-min

咋个搞吗

zhongchaoze avatar Jul 23 '20 11:07 zhongchaoze

咋个搞吗

作者不是修复了吗

jverygood avatar Jul 23 '20 11:07 jverygood