K
K
您好!我和您遇到了相同的报错信息,ValueError: Pointer shape torch.Size([128]) and array shape (312,) mismatched。请问您找到解决办法了吗?
请问您解决了吗
@msclock 请问按照[albert_pytorch](https://github.com/lonePatient/albert_pytorch/tree/master) /convert_albert_tf_checkpoint_to_pytorch.py 文件来就可以吗
> @DoverDW albert_zh生成的好像有两个版本,一个是[https://github.com/brightmart/albert_zh/blob/master/modeling.py的](https://github.com/brightmart/albert_zh/blob/master/modeling.py%E7%9A%84), 一个是[https://github.com/brightmart/albert_zh/blob/master/modeling_google.py版本](https://github.com/brightmart/albert_zh/blob/master/modeling_google.py%E7%89%88%E6%9C%AC). modeling_google版本好像可以直接用huggingface transformers albert转换,我这边项目做一个分类的子任务拿到是这个https://github.com/brightmart/albert_zh/blob/master/modeling.py 生成保存的ckpt模型, 里面对应/workspaces/ai-serving-solution/CLUE/baselines/models_pytorch/classifier_pytorch/convert_albert_original_tf_checkpoint_to_pytorch.py 转换脚本, 还要改一下,增加分类子任务的输出权重绑定到模型属性方式/workspaces/ai-serving-solution/CLUE/baselines/models_pytorch/classifier_pytorch/transformers/modeling_albert.py的函数load_tf_weights_in_albert > > ```python > for name, array in zip(names, arrays): > name = name.split("/") > # adam_v and adam_m...
你好,请问改好了吗