ImportError: cannot import name 'SAVE_STATE_WARNING' from 'torch.optim.lr_scheduler' - SAVE_STATE_WARNING has been removed from pytorch
ERROR:
..../my37/lib/python3.7/site-packages/transformers/trainer_pt_utils.py", line 40, in <module>
    from torch.optim.lr_scheduler import SAVE_STATE_WARNING
ImportError: cannot import name 'SAVE_STATE_WARNING' from 'torch.optim.lr_scheduler' (......./my37/lib/python3.7/site-packages/torch/optim/lr_scheduler.py)

Please update transformers to be compatible with the latest pytorch source code (build from master branch:
'SAVE_STATE_WARNING' was removed from pytorch a few days ago.
.I can see you have fixed this in the source code.<|||||>I just upgraded to torch 1.8 and I got this error. 

```ImportError while importing test module '/home/dwalter/Documents/projects/lm/lm_ml/modules/quantization/tests/test_quantize.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/home/dwalter/anaconda3/envs/lm-torch1.8/lib/python3.6/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_quantize.py:7: in <module>
    import quantization.fused_nn as qnni
quantization/__init__.py:2: in <module>
    from .fused_nn import ConvNL2d
quantization/fused_nn.py:4: in <module>
    from .nn import Conv2d
quantization/nn/__init__.py:8: in <module>
    import transformers.modeling_bert as bert
/home/dwalter/anaconda3/envs/lm-torch1.8/lib/python3.6/site-packages/transformers/__init__.py:626: in <module>
    from .trainer import Trainer
/home/dwalter/anaconda3/envs/lm-torch1.8/lib/python3.6/site-packages/transformers/trainer.py:69: in <module>
    from .trainer_pt_utils import (
/home/dwalter/anaconda3/envs/lm-torch1.8/lib/python3.6/site-packages/transformers/trainer_pt_utils.py:40: in <module>
    from torch.optim.lr_scheduler import SAVE_STATE_WARNING
E   ImportError: cannot import name 'SAVE_STATE_WARNING'
```
Is there something I need to fix in my code or did I not upgrade correctly?
upgraded with `pip install --upgrade torch`<|||||>@dwalterlm you're probably on an older Transformers version. This was fixed in https://github.com/huggingface/transformers/pull/8979, could you try upgrading to a more recent version, like `v4.3.0`?<|||||>> 

the version of torch is too high,try use : torch 1.7.1