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放在web里面就无法运行,拿出来之后error calling function #158

Open
ricepudcm opened this issue Apr 16, 2023 · 3 comments

Comments

@ricepudcm
Copy link

Traceback (most recent call last):
File "/Users/ricepudding/Desktop/chatbot-master-2/Chatbot_pytorch/Seq2seqchatbot/web/app.py", line 5, in
import execute
File "/Users/ricepudding/Desktop/chatbot-master-2/Chatbot_pytorch/Seq2seqchatbot/execute.py", line 81, in
input_tensor,input_lang,target_tensor,target_lang= read_data(gConfig['seq_data'], gConfig['max_train_data_size'])
File "/Users/ricepudding/Desktop/chatbot-master-2/Chatbot_pytorch/Seq2seqchatbot/execute.py", line 74, in read_data
input_lang,target_lang,pairs=create_dataset(path,num_examples)
File "/Users/ricepudding/Desktop/chatbot-master-2/Chatbot_pytorch/Seq2seqchatbot/execute.py", line 25, in create_dataset
lines = io.open(path, encoding='UTF-8').read().strip().split('\n')
FileNotFoundError: [Errno 2] No such file or directory: 'train_data/seq.data'

@ricepudcm
Copy link
Author

拿出来之后:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/flask/app.py", line 2528, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/flask/app.py", line 1825, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ricepudding/Desktop/chatbot-master-2/Chatbot_pytorch/Seq2seqchatbot/app.py", line 43, in reply
res_msg = execute.predict(req_msg)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ricepudding/Desktop/chatbot-master-2/Chatbot_pytorch/Seq2seqchatbot/execute.py", line 123, in predict
checkpoint=torch.load(checkpoint_prefix)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/torch/serialization.py", line 791, in load
with _open_file_like(f, 'rb') as opened_file:
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/torch/serialization.py", line 271, in _open_file_like
return _open_file(name_or_buffer, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/torch/serialization.py", line 252, in init
super().init(open(name, mode))
^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'model_data/.pt'
127.0.0.1 - - [16/Apr/2023 21:13:37] "�[35m�[1mPOST /message HTTP/1.1�[0m" 500 -

@cmyopi
Copy link

cmyopi commented May 12, 2023

缺少model_data./pt

@yaoye-aiyan
Copy link

这个model_data./pt怎么搞呢

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