随笔分类 - python学习
摘要:解决报错内容: RuntimeError: Error(s) in loading state_dict for PyTorchBasedGPT2: size mismatch for transformer.h.0.attn.c_attn.weight: copying a param with
阅读全文
摘要:python中的数据结构Dict和Set使用hash存储,无法按有序状态遍历。可以使用OrderedDict使字典变为有序,用sort方法使set还原顺序。 一、OrderedDict python3.6之后,可以通过from collections import OrderedDict,使用有序字
阅读全文