Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行app.py时出现error calling function #170

Open
pxlm570 opened this issue Oct 24, 2023 · 3 comments
Open

运行app.py时出现error calling function #170

pxlm570 opened this issue Oct 24, 2023 · 3 comments

Comments

@pxlm570
Copy link

pxlm570 commented Oct 24, 2023

运行app.py时出现error calling function,报错信息如下:
192.168.160.211 - - [24/Oct/2023 15:11:15] "GET / HTTP/1.1" 200 -
192.168.160.211 - - [24/Oct/2023 15:11:15] "GET /static/res/hd2.jpg HTTP/1.1" 404 -
Building prefix dict from the default dictionary ...
Loading model from cache C:\Users\86181\AppData\Local\Temp\jieba.cache
Loading model cost 0.654 seconds.
Prefix dict has been built successfully.
[2023-10-24 15:11:19,667] ERROR in app: Exception on /message [POST]
Traceback (most recent call last):
File "D:\Anaconda\lib\site-packages\flask\app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "D:\Anaconda\lib\site-packages\flask\app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "D:\Anaconda\lib\site-packages\flask\app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "D:\Anaconda\lib\site-packages\flask_compat.py", line 39, in reraise
raise value
File "D:\Anaconda\lib\site-packages\flask\app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "D:\Anaconda\lib\site-packages\flask\app.py", line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File "C:\Users\86181\Desktop\Seq2SeqChatbot\web\app.py", line 43, in reply
res_msg = execute.predict(req_msg)
File "C:\Users\86181\Desktop\Seq2SeqChatbot\execute.py", line 124, in predict
checkpoint=torch.load(checkpoint_prefix)
File "D:\Anaconda\lib\site-packages\torch\serialization.py", line 771, in load
with _open_file_like(f, 'rb') as opened_file:
File "D:\Anaconda\lib\site-packages\torch\serialization.py", line 270, in _open_file_like
return _open_file(name_or_buffer, mode)
File "D:\Anaconda\lib\site-packages\torch\serialization.py", line 251, in init
super(_open_file, self).init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'model_data.pt'
192.168.160.211 - - [24/Oct/2023 15:11:19] "POST /message HTTP/1.1" 500 -

请问是'model_data.pt'存在问题吗,或者说问题出在execute.py中predict函数的checkpoint=torch.load(checkpoint_prefix)语句?
后面的报错"POST /message HTTP/1.1" 500 -指的是什么意思呢?
请问如何解决该问题?

@pxlm570
Copy link
Author

pxlm570 commented Oct 24, 2023

采用的是pytorch版本

@Kai666333
Copy link

解决了吗

@Fuji-021
Copy link

Fuji-021 commented May 3, 2024

你好,请问现在解决了吗,大佬请问一下这个网页模型我该如何部署呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants