thiborose / gecko-app

A web application that interfaces two GEC systems. [web instance is down]
https://gecko-app.azurewebsites.net/
Other
31 stars 9 forks source link

the package allennlp has changed to a newer version and is not compatible anymore with this code #23

Closed Snoussi88 closed 3 years ago

Snoussi88 commented 3 years ago

after some tweaks to the code, i'm now able to run python run.py but it does not seem to work for me i get the following message :

05/08/2021 00:13:34 - WARNING - application.models.sentence_reorder.model - Process rank: -1, device: cuda, n_gpu: 1, distributed training: False, 16-bits training: False Some weights of the model checkpoint at bert-base-uncased were not used when initializing BertForSequenceClassification: ['cls.predictions.bias', 'cls.predictions.transform.dense.weight', 'cls.predictions.transform.dense.bias', 'cls.predictions.decoder.weight', 'cls.seq_relationship.weight', 'cls.seq_relationship.bias', 'cls.predictions.transform.LayerNorm.weight', 'cls.predictions.transform.LayerNorm.bias']

This IS expected if you are initializing BertForSequenceClassification from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model). This IS NOT expected if you are initializing BertForSequenceClassification from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model). Some weights of BertForSequenceClassification were not initialized from the model checkpoint at bert-base-uncased and are newly initialized: ['classifier.weight', 'classifier.bias'] You should probably TRAIN this model on a down-stream task to be able to use it for predictions and

and on localhost:5000 it doesn't seem to correct anything showing only Gecko seems to be tired today... (︶︹︶)

Snoussi88 commented 3 years ago

on the other hand, if i run python run.py in vscode, it gives the same message + this

You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.

  • Serving Flask app "application" (lazy loading)
  • Environment: development
  • Debug mode: on Traceback (most recent call last): File "C:\Users\snous\OneDrive\Desktop\github\gecko-app\run.py", line 1, in from application import app File "C:\Users\snous\OneDrive\Desktop\github\gecko-app\application__init.py", line 2, in from application.models.gector import model File "C:\Users\snous\OneDrive\Desktop\github\gecko-app\application\models\gector\model.py", line 2, in from application.models.gector.gector.gec_model import GecBERTModel File "C:\Users\snous\OneDrive\Desktop\github\gecko-app\application\models\gector\gector\gec_model.py", line 7, in import torch File "C:\Users\snous\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\init__.py", line 123, in raise err OSError: [WinError 1455] The paging file is too small for this operation to complete. Error loading "C:\Users\snous\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\lib\caffe2_detectron_ops_gpu.dll" or one of its dependencies.
thiborose commented 3 years ago

The requirements file specifies the versions of the packages - Even if Allennlp got updated recently, gecko will still be depending on the old version. Everything seems fine to me.

Did you install the dependencies from the requirements file ?

Snoussi88 commented 3 years ago

The requirements file specifies the versions of the packages - Even if Allennlp got updated recently, gecko will still be depending on the old version. Everything seems fine to me.

Did you install the dependencies from the requirements file ?

yes, except for pytorch the version you are referring to, does not exist anymore on the released versions at least : https://pytorch.org/get-started/previous-versions/ ==> i only found pytorch==1.0.1 or pytorch==1.1.0 and definitely not pytorch==1.2.1 is it ok ? anyways does it still work for you ?

thiborose commented 3 years ago

Try to upgrade pip pip install pip --upgrade, and then install pytorch1.3.0 via pip. Else, you may try with conda. (these tips are mentioned at the end of the requirements file)

It can also be related to your OS. The installation has proven to work better on linux.

No out-of-the-box solution here, sorry! Feel free to reopen if needed.