pytorch中TypeError

问题遇到的现象和发生背景

pytorch运行train.py时

用代码块功能插入代码,请勿粘贴截图
  if (
        getattr(cls, '_is_protocol', False) and
        not getattr(cls, '_is_runtime_protocol', False) and
        not _allow_reckless_class_checks(depth=2)
    ):
        raise TypeError("Instance and class checks can only be used with"
                        " @runtime_checkable protocols")
运行结果及报错内容

TypeError: Instance and class checks can only be used with @runtime_checkable protocols

将python版本回退至3.7就可以解决了,这是版本不兼容导致的。