AttributeError: ‘str‘ object has no attribute ‘size‘

batch_size = key.size(0)

AttributeError: 'str' object has no attribute 'size'

transformers 版本不对。

pip install transformers==2.11.0

你可能感兴趣的:(笔记,pytorch)