Repository: open-mmlab/mmocr

Issue:
RuntimeError: Only one file(not dir) is allowed in the zipfile - SATRN
I am running the following
```
        python mmocr/utils/ocr.py \
                data/vivino/data/images/0.jpg \
                --output data/0_output_$recog_method.jpg \
                --det TextSnake \
                --recog SATRN \
                --print-result

```
and it returns the following error - seems it downloads the checkpoint but has problem in unpacking it.
```

Downloading: "https://download.openmmlab.com/mmocr/textrecog/satrn/satrn_academic_20210809-59c8c92d.pth" to /root/.cache/torch/hub/checkpoints/satrn_academic_20210809-59c8c92d.pth
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████| 252M/252M [00:23<00:00, 11.3MB/s]
Traceback (most recent call last):
  File "mmocr/utils/ocr.py", line 692, in <module>
    main()
  File "mmocr/utils/ocr.py", line 687, in main
    ocr = MMOCR(**vars(args))
  File "mmocr/utils/ocr.py", line 356, in __init__
    recog_config, recog_ckpt, device=self.device)
  File "/mmocr/mmocr/apis/inference.py", line 44, in init_detector
    checkpoint = load_checkpoint(model, checkpoint, map_location=map_loc)
  File "/opt/conda/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 513, in load_checkpoint
    checkpoint = _load_checkpoint(filename, map_location, logger)
  File "/opt/conda/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 451, in _load_checkpoint
    return CheckpointLoader.load_checkpoint(filename, map_location, logger)
  File "/opt/conda/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 244, in load_checkpoint
    return checkpoint_loader(filename, map_location)
  File "/opt/conda/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 284, in load_from_http
    filename, model_dir=model_dir, map_location=map_location)
  File "/opt/conda/lib/python3.7/site-packages/torch/hub.py", line 490, in load_state_dict_from_url
    raise RuntimeError('Only one file(not dir) is allowed in the zipfile')
RuntimeError: Only one file(not dir) is allowed in the zipfile

```

I have made sure my mmocr is the up to date by doing `git pull`


Discussion:
What's your PyTorch version? The checkpoint should be compatible with PyTorch >= 1.6.
I am using 1.6.0 (through the docker of course)
```
>>> import torch
>>> torch.__version__
'1.6.0'
```


Thanks for the feedback! SATRN checkpoints turn out to be saved by PyTorch 1.8 which uses a new serialization algorithm by default and break their backward compatibility. We just uploaded two backward-compatible checkpoints, please check them out:
https://download.openmmlab.com/mmocr/textrecog/satrn/satrn_academic_20211009-cb8b1580.pth
https://download.openmmlab.com/mmocr/textrecog/satrn/satrn_small_20211009-2cf13355.pth

Resolving patch:
diff --git a/mmocr/utils/ocr.py b/mmocr/utils/ocr.py
--- a/mmocr/utils/ocr.py
+++ b/mmocr/utils/ocr.py
@@ -281,11 +281,11 @@ def __init__(self,
             },
             'SATRN': {
                 'config': 'satrn/satrn_academic.py',
-                'ckpt': 'satrn/satrn_academic_20210809-59c8c92d.pth'
+                'ckpt': 'satrn/satrn_academic_20211009-cb8b1580.pth'
             },
             'SATRN_sm': {
                 'config': 'satrn/satrn_small.py',
-                'ckpt': 'satrn/satrn_small_20210811-2badf6fc.pth'
+                'ckpt': 'satrn/satrn_small_20211009-2cf13355.pth'
             },
             'SEG': {
                 'config': 'seg/seg_r31_1by16_fpnocr_academic.py',


Test patch: