LucasRoesler / name-classifier

Sample OpenFaaS function that will try to guess your nationality based on your name, using pytorch
10 stars 5 forks source link

Error finding char-rnn-classification.pt model #2

Open rohanmahapatra opened 2 years ago

rohanmahapatra commented 2 years ago

Hello,

I am new to OpenFaaS and wanted to try the classify function. However, I get the below error. Could you please help? I can see the file char-rnn-classification.p is present in the directory but I do not know the reason why the error is getting generated.

============================= test session starts ============================== platform linux -- Python 3.9.7, pytest-7.0.0, pluggy-0.13.1 cachedir: .tox/test/.pytest_cache rootdir: /home/app/function collected 0 items / 1 error

==================================== ERRORS ==================================== _____ ERROR collecting handler_test.py ___ handler_test.py:2: in from .handler import handle handler.py:17: in torch.load(str(PurePath(FUNCTION_ROOT, "data/char-rnn-classification.pt"))) ../conda/lib/python3.9/site-packages/torch/serialization.py:594: in load with _open_file_like(f, 'rb') as opened_file: ../conda/lib/python3.9/site-packages/torch/serialization.py:230: in _open_file_like return _open_file(name_or_buffer, mode) ../conda/lib/python3.9/site-packages/torch/serialization.py:211: in init super(_open_file, self).init__(open(name, mode)) E FileNotFoundError: [Errno 2] No such file or directory: '/root/function/data/char-rnn-classification.pt' =========================== short test summary info ============================ ERROR handler_test.py - FileNotFoundError: [Errno 2] No such file or director... !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! =============================== 1 error in 1.02s =============================== ERROR: InvocationError for command /home/app/conda/bin/pytest (exited with code 2)

AnishEllore commented 2 years ago

I changed TEST_ENABLED to false in Dockerfile. Now my function is working without any errors