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

IndexError: list index out of range #4

Open
fathia-ghribi opened this issue Dec 12, 2020 · 0 comments
Open

IndexError: list index out of range #4

fathia-ghribi opened this issue Dec 12, 2020 · 0 comments

Comments

@fathia-ghribi
Copy link

when i try this code from module explore_model.ipynb
`for each, epoch in model_list2[:-1:(len(model_list2)//10)+1][:2] + [model_list2[-1]]:
state = torch.load(f'{each}', map_location=lambda storage, loc: storage)
doc_weights = state['doc_weights.weight'].cpu().clone().numpy()

# distribution over the topics for each document
topic_dist = softmax(doc_weights)

# distribution of nonzero probabilities
dist = topic_dist.reshape(-1)
plt.hist(dist[dist > 0.01], bins=40);
plt.title(f'epoch: {epoch}')
plt.show()`

, i'm getting this error :
`IndexError Traceback (most recent call last)
in
----> 1 for each, epoch in model_list2[:-1:(len(model_list2)//10)+1][:2] + [model_list2[-1]]:
2 state = torch.load(f'{each}', map_location=lambda storage, loc: storage)

IndexError: list index out of range`
how to fix this plz ??

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

1 participant