HHousen / TransformerSum

Models to perform neural summarization (extractive and abstractive) using machine learning transformers and a tool to convert abstractive summarization datasets to the extractive task.
https://transformersum.rtfd.io
GNU General Public License v3.0
429 stars 58 forks source link

Some versioning problems when installing the environment #78

Closed ornithos closed 1 year ago

ornithos commented 1 year ago

Thanks for this project @HHousen and the great docs!

I've been playing around with Getting Started and encountered a couple of errors, one of which was addressed here (the strict=False fix).

Something which I haven't found anywhere yet is the following stacktrace, which after digging through Pytorch Lightning (PL) releases appears to be an error due to a refactor at version 1.7.0.

Traceback (most recent call last):
  File "/.../TransformerSum/predictions_website.py", line 8, in <module>
    from extractive import ExtractiveSummarizer  # noqa: E402
  File "/.../TransformerSum/src/extractive.py", line 27, in <module>
    from data import FSDataset, FSIterableDataset, SentencesProcessor, pad_batch_collate
  File "/.../TransformerSum/src/data.py", line 14, in <module>
    from helpers import pad
  File "/.../TransformerSum/src/helpers.py", line 51, in <module>
    class StepCheckpointCallback(pl.callbacks.base.Callback):
AttributeError: module 'pytorch_lightning.callbacks' has no attribute 'base'

Since this is a breaking change in PL and TransformerSum is somewhat old I feel the best fix is just to downgrade pytorch-lightning as follows:

pip install pytorch-lightning==1.6.5

I also needed to specify python==3.10 in the environment definition since PL doesn't work under 3.11 yet. Perhaps other users would be helped by specifying these versions within the environment.yml file?

g-surkis commented 1 year ago

Hi there. Have the same issue.

HHousen commented 1 year ago

Good idea to fix this! Did pinning only python and pytorch-lightning solve all version issues for you?

I pinned everything in the environment.yml file so this doesn't happen again. I created a new environment with the pinned versions and tested extractive training and inference and it seems to work.