BlinkDL/AI-Writer

_pickle.UnpicklingError: invalid load key, '\x08'.

kelisima001 opened this issue · 1 comments

python3.9
torch1.10.1
使用的是A.-.-wangwen-2022-02-15.zip
wangwen-2022-02-15.onnx后缀名需要改为 pth?

报bug
C:\Users\Administrator\AppData\Local\Programs\Python\Python39\python.exe D:/workspace/python/AI-Writer/run.py

AI人工智障写作 https://github.com/BlinkDL/AI-Writer
请关注我的知乎 https://zhuanlan.zhihu.com/p/423646620

声明:模型的训练数据全部来自网文,缺乏生活常识。生成的文字仅供娱乐。请遵守法律法规。
您输入的开头有 5 个字。注意,模型只会看最后 512 个字。

Loading model for cpu... Traceback (most recent call last):
File "D:\workspace\python\AI-Writer\run.py", line 92, in
m2 = torch.load(MODEL_NAME + '.pth', map_location='cpu').state_dict()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\serialization.py", line 608, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\serialization.py", line 777, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, '\x08'.

Process finished with exit code 1

你好,onnx和pth是完全不同的模型,请下载自己显卡对应的模型,并且设置 RUN_DEVICE 为相应的设置。