timbmg / Sentence-VAE

PyTorch Re-Implementation of "Generating Sentences from a Continuous Space" by Bowman et al 2015 https://arxiv.org/abs/1511.06349
580 stars 152 forks source link

Index Error during Inference #24

Closed tnhaider closed 3 years ago

tnhaider commented 3 years ago

Hi,

When I run inference on my trained vanilla model I often geht an error that there are too many indices for tensor of dimension 0.

$ python inference.py --data_dir data/dlk_txt/ -c models/dlk_model_1/2020-Aug-07-08\:43\:03/E19.pytorch -n 5
Model loaded from models/dlk_model_1/2020-Aug-07-08:43:03/E19.pytorch
Traceback (most recent call last):
  File "inference.py", line 80, in <module>
    main(args)
  File "inference.py", line 44, in main
    samples, z = model.inference(n=args.num_samples)
  File "/mnt/[...]/vae/Sentence-VAE/model.py", line 172, in inference
    input_sequence = input_sequence[running_seqs]
IndexError: too many indices for tensor of dimension 0

I downgraded my python 3.6 virtual environment according to the requirements.txt, but the error still persists.

Have you seen this before?

Thanks.

good74152 commented 3 years ago

same error, did you fixed it?

timbmg commented 3 years ago

should now be solved by #26