-
Install Pytorch (pick config at will):
-
Install latest Pytorch NLP version:
$ pip install git+https://github.com/PetrochukM/PyTorch-NLP.git -
Install remaining requirements:
$ pip install -r requirements.txt$ python -m spacy download en
$ python run.py model dataset
e.g. - Hierarchical Attention Network on IMDB dataset
$ python run.py han imdb
-
I'm getting the following error:
RuntimeError: "view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead."Solution: Update pytorch-nlp to its latest version:
$ pip uninstall pytorch-nlp $ pip install git+https://github.com/PetrochukM/PyTorch-NLP.git