Problems with Pytorch file version of reading

Tried to uninstall and reinstall several different versions from the attempted solution in other threads.

But still encounter this issue of not getting the “supported version for reading”.

Wonder if it is due to the compatibility of windows?
cause it still happens even if I installed the latest version

in __init__
    super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))

RuntimeError: version_ <= kMaxSupportedFileFormatVersion INTERNAL ASSERT FAILED 
at ..\caffe2\serialize\inline_container.cc:132, please report a bug to PyTorch. 
Attempted to read a PyTorch file with version 3, but the maximum supported version for reading is 2. 
Your PyTorch installation may be too old. (init at ..\caffe2\serialize\inline_container.cc:132)
(no backtrace available)

windows 10 1909 (18363.1016)

CPU: AMD 4800HS

GPU: 1650Ti

Pytorch version:1.4.0+cu92

torchvision version: 0.5.0

Python version: 3.7

Compiler: Spyder(anaconda 3)

import syft

The latest version is 1.6.0 at the moment and soon 1.7 so could you update it and rerun the code?

Thanks.
Then I updated to 1.7.0
And the output becomes as below
Is it due to the dependencies or compatibility?

Traceback (most recent call last):

  File "C:\Users\Lee\Downloads\HW4\Q2\federated_learning.py", line 5, in <module>
    from torchvision import datasets, transforms

  File "C:\Users\Lee\AppData\Roaming\Python\Python37\site-packages\torchvision\__init__.py", line 3, in <module>
    from torchvision import models

  File "C:\Users\Lee\AppData\Roaming\Python\Python37\site-packages\torchvision\models\__init__.py", line 12, in <module>
    from . import detection

  File "C:\Users\Lee\AppData\Roaming\Python\Python37\site-packages\torchvision\models\detection\__init__.py", line 1, in <module>
    from .faster_rcnn import *

  File "C:\Users\Lee\AppData\Roaming\Python\Python37\site-packages\torchvision\models\detection\faster_rcnn.py", line 14, in <module>
    from .roi_heads import RoIHeads

  File "C:\Users\Lee\AppData\Roaming\Python\Python37\site-packages\torchvision\models\detection\roi_heads.py", line 211, in <module>
    @torch.jit.script

  File "C:\Users\Lee\anaconda3\lib\site-packages\torch\jit\__init__.py", line 1281, in script
    fn = torch._C._jit_script_compile(qualified_name, ast, _rcb, get_default_args(obj))

  File "C:\Users\Lee\anaconda3\lib\site-packages\torch\jit\_recursive.py", line 555, in try_compile_fn
    return torch.jit.script(fn, _rcb=rcb)

  File "C:\Users\Lee\anaconda3\lib\site-packages\torch\jit\__init__.py", line 1281, in script
    fn = torch._C._jit_script_compile(qualified_name, ast, _rcb, get_default_args(obj))

  File "C:\Users\Lee\anaconda3\lib\site-packages\torch\jit\_recursive.py", line 555, in try_compile_fn
    return torch.jit.script(fn, _rcb=rcb)

  File "C:\Users\Lee\anaconda3\lib\site-packages\torch\jit\__init__.py", line 1278, in script
    ast = get_jit_def(obj)

  File "C:\Users\Lee\anaconda3\lib\site-packages\torch\jit\frontend.py", line 171, in get_jit_def
    return build_def(ctx, py_ast.body[0], type_line, self_name)

  File "C:\Users\Lee\anaconda3\lib\site-packages\torch\jit\frontend.py", line 212, in build_def
    build_stmts(ctx, body))

  File "C:\Users\Lee\anaconda3\lib\site-packages\torch\jit\frontend.py", line 127, in build_stmts
    stmts = [build_stmt(ctx, s) for s in stmts]

  File "C:\Users\Lee\anaconda3\lib\site-packages\torch\jit\frontend.py", line 127, in <listcomp>
    stmts = [build_stmt(ctx, s) for s in stmts]

  File "C:\Users\Lee\anaconda3\lib\site-packages\torch\jit\frontend.py", line 186, in __call__
    raise UnsupportedNodeError(ctx, node)

UnsupportedNodeError: import statements aren't supported

I haven’t seen this error before.
Could you upload the file somewhere so that we could try to reproduce it, please?

python source code
Is it okay to share via google drive?

I would prefer if you could post it here directly or e.g. in a GitHub gist.

Shared GitHub gist:

Thanks for the code. How can I reproduce this issue with it?
Do I have to run it once with the save option and then somehow try to load it in a second run?

Yeah, it will download a small part of dataset in a folder contain a folder MNIST.
And after that, it should be able to train but sometime it shows the error above.