BlinkDL / AI-Writer

AI 写小说,生成玄幻和言情网文等等。中文预训练生成模型。采用我的 RWKV 模型,类似 GPT-2 。AI写作。RWKV for Chinese novel generation.
Apache License 2.0
2.91k stars 515 forks source link

AttributeError: 'dict' object has no attribute 'state_dict' #13

Open codeloversky opened 1 year ago

codeloversky commented 1 year ago

你好,这个模型跑起来还是挺强的,我用cpu模型可以正常使用,但是在换成gpu模式的时候出了点问题,在使用n卡模型运行时提示出错Loading model for gpu... Traceback (most recent call last): File "run.py", line 90, in m2 = torch.load(MODEL_NAME + '.pth', map_location='cpu').state_dict() AttributeError: 'dict' object has no attribute 'state_dict' 都检查了一遍,模型没问题,网上查找了很多相关的问题,都没能解决,能否请教一下怎么解决掉?非常感谢!!

rootdgy commented 1 year ago

同样的问题

BlinkDL commented 1 year ago

huggingface的模型用ChatRWKV运行。AI-writer的模型用这个:https://github.com/BlinkDL/AI-Writer/releases/tag/v2022-02-15

codeloversky commented 1 year ago

大佬,我应该是用错模型了,我是直接在你的huggingface上面找的模型,现在用N卡模型可以了,谢谢

chilldenpa commented 1 year ago

6GB的