Open antoinecomp opened 2 years ago
Hi @antoinecomp, thank you for bringing it up. Yes, we need to update the versions. Do you mean pytorch or torchtext version ?
Hi @NarineK ! torchtext sorry !
Yes I'm having difficulty here as well. Can't get this notebook to run on my machine, perhaps due to slightly different versions of torchtext, pytorch, etc. even though I tried to ensure that the setup was done correctly. Would hugely appreciate an update to the notebook and more detailed documentation on the third party software used!
captum 0.5.0 spacy 3.4.3 torch 1.13.0+cu117 torchtext 0.14.0
model = torch.load('models/imdb-model-cnn-large.pt')
/home/george/.local/lib/python3.10/site-packages/torch/serialization.py:868: SourceChangeWarning: source code of class 'torch.nn.modules.sparse.Embedding' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/george/.local/lib/python3.10/site-packages/torch/serialization.py:868: SourceChangeWarning: source code of class 'torch.nn.modules.container.ModuleList' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
...
two years and still an issue!
captum 0.7.0
torch 2.3.0
torchtext 0.18.0
spacy 3.7.6
i'd like to be able to replicate the results in this tutorial, but can't figure out how to get the vocabulary associated with the pre-trained CNN's embedding?
interpret_sentence()
makes critical use of the legacy TEXT.vocab.stoi()
and Label.vocab.itos()
dropped by torchtext version >= 0.9?
I think the PyTorch version used in the IMDB_TorchText_Interpret tutorial is deprecated. Indeed, the tutorial uses a small subset of test data from IMDB dataset using torchtext:
then it uses
.pad_token
, as well as a method like.vocab.stoi
. However all of these disappeared in pytorch 0.9.0. But even when downloading the former I got the following error on Google Colab: