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

An error running your DETM script #1

Closed
Emekaborisama opened this issue Jan 5, 2021 · 2 comments
Closed

An error running your DETM script #1

Emekaborisama opened this issue Jan 5, 2021 · 2 comments

Comments

@Emekaborisama
Copy link

I tried using your script to train DETM but this error occur. pls can you help me fix it

Traceback (most recent call last): File "main.py", line 476, in <module> train(epoch) File "main.py", line 217, in train loss, nll, kl_alpha, kl_eta, kl_theta = model(data_batch, normalized_data_batch, times_batch, train_rnn_inp, args.num_docs_train) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "/content/drive/My Drive/eu/run_file/detm.py", line 199, in forward theta, kl_theta = self.get_theta(eta, normalized_bows, times) File "/content/drive/My Drive/eu/run_file/detm.py", line 161, in get_theta eta_td = eta[times.type('torch.LongTensor')] IndexError: index 66 is out of bounds for dimension 0 with size 66

@quynhneo
Copy link
Owner

quynhneo commented Jan 5, 2021

It looks like some settings mismatch. I have just updated main.py, can you pull and try to run again, using all default settings, see if you have working code ? This runs well for me.
You will have to change two lines:
https://github.com/quynhneo/DETM/blob/master/main.py#L34: points to the folder where you keep min_df_30 from preprocessed data, which you can get from here https://bitbucket.org/franrruiz/data_undebates_largev/src/master/split_paragraph_1/min_df_30/ for the UN debates
https://github.com/quynhneo/DETM/blob/master/main.py#L35 : path to prefit embedding which you can get from here https://bitbucket.org/diengadji/embeddings/src/master/un/ for the UN debates
then run all defaults python main.py
Let me know.

@quynhneo
Copy link
Owner

quynhneo commented Jan 6, 2021

still error? Did you use all default settings? that is, replace the data , and just run python main.py? which data set did you try to run on?

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

2 participants