当想读入现有的模型,而且并不是同意台电脑预训练的模型,而且需要跨python版本,就会出现下面的情况。
官方也有issue说这个, 里面的方法我并没有解决问题
上面的方法读出来只是一个int,至于为什么还没弄清。
虽然官方说已经在写好patch,但是大概没有在现有版本中release. github.request
这其实是python 2/3 对于str的编码方式的差别的问题。
源码中的注释有写到:
.. note::
In Python 3, when loading files saved by Python 2, you may encounter
``UnicodeDecodeError: 'ascii' codec can't decode byte 0x...``. This is
caused by the difference of handling in byte strings in Python2 and
Python 3. You may use extra ``encoding`` keyword argument t