JohnGiorgi / DeCLUTR

The corresponding code from our paper "DeCLUTR: Deep Contrastive Learning for Unsupervised Textual Representations". Do not hesitate to open an issue if you run into any trouble!
https://aclanthology.org/2021.acl-long.72/
Apache License 2.0
378 stars 33 forks source link

Does the training notebook not work in windows jupyter notebook #221

Closed kingafy closed 3 years ago

kingafy commented 3 years ago

I was trying to train on my local GPU machine . It is a windows machine and am running the training notebook instructions in jupyter notebook but I am getting errors:- 2021-05-20 11:35:33,096 - WARNING - allennlp.common.params - error loading _jsonnet (this is expected on Windows), treating declutr_base.jsonnet as plain json Traceback (most recent call last): File "c:\users\anshuman.a.mahapatra\anaconda3\envs\declutr\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "c:\users\anshuman.a.mahapatra\anaconda3\envs\declutr\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\anshuman.a.mahapatra\Anaconda3\envs\declutr\Scripts\allennlp.exe__main.py", line 7, in File "c:\users\anshuman.a.mahapatra\anaconda3\envs\declutr\lib\site-packages\allennlp\main.py", line 34, in run main(prog="allennlp") File "c:\users\anshuman.a.mahapatra\anaconda3\envs\declutr\lib\site-packages\allennlp\commands\init.py", line 92, in main args.func(args) File "c:\users\anshuman.a.mahapatra\anaconda3\envs\declutr\lib\site-packages\allennlp\commands\train.py", line 118, in train_model_from_args file_friendly_logging=args.file_friendly_logging, File "c:\users\anshuman.a.mahapatra\anaconda3\envs\declutr\lib\site-packages\allennlp\commands\train.py", line 168, in train_model_from_file params = Params.from_file(parameter_filename, overrides) File "c:\users\anshuman.a.mahapatra\anaconda3\envs\declutr\lib\site-packages\allennlp\common\params.py", line 491, in from_file file_dict = json.loads(evaluate_file(params_file, ext_vars=ext_vars)) File "c:\users\anshuman.a.mahapatra\anaconda3\envs\declutr\lib\json\init__.py", line 354, in loads return _default_decoder.decode(s) File "c:\users\anshuman.a.mahapatra\anaconda3\envs\declutr\lib\json\decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "c:\users\anshuman.a.mahapatra\anaconda3\envs\declutr\lib\json\decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

JohnGiorgi commented 3 years ago

Hi,

The most immediate problem is that jsonnet wasn't loaded

WARNING - allennlp.common.params - error loading jsonnet (this is expected on Windows), treating declutr_base.jsonnet as plain json

This is going to cause problems as the config is not valid JSON. You could try to convert the jsonnet configs to valid JSON (e.g. by removing variables and hardcoding values) but you will likely just run into further issues downstream.

More generally though, AllenNLP is not supported on windows. Unfortunately, you likely have to try and train on a MacOS or Linux machine.