the-full-stack / fsdl-text-recognizer-2021-labs

Complete deep learning project developed in Full Stack Deep Learning, Spring 2021
https://bit.ly/berkeleyfsdl
MIT License
452 stars 281 forks source link

Lab9: Can't run python api_server/app.py #43

Open astrogopher opened 2 years ago

astrogopher commented 2 years ago

I've been following along with the course, and on lab 9 section "Serving predictions from a web server" when I go to call

python api_server/app.py

I get the following error:

`(fsdl-text-recognizer-2021) astrogopher@astrogopher lab9 % python api_server/app.py Traceback (most recent call last): File "api_server/app.py", line 14, in model = ParagraphTextRecognizer()

File "/Users/astrogopher/fsdl-text-recognizer-2021-labs/lab9/text_recognizer/paragraph_text_recognizer.py", line 35, in init checkpoint_path=CONFIG_AND_WEIGHTS_DIRNAME / "model.pt", args=args, model=model

File "/Users/astrogopher/opt/miniconda3/envs/fsdl-text-recognizer-2021/lib/python3.6/site-packages/pytorch_lightning/core/saving.py", line 135, in load_from_checkpoint checkpoint = pl_load(checkpoint_path, map_location=lambda storage, loc: storage)

File "/Users/astrogopher/opt/miniconda3/envs/fsdl-text-recognizer-2021/lib/python3.6/site-packages/pytorch_lightning/utilities/cloud_io.py", line 32, in load return torch.load(f, map_location=map_location)

File "/Users/astrogopher/opt/miniconda3/envs/fsdl-text-recognizer-2021/lib/python3.6/site-packages/torch/serialization.py", line 595, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)

File "/Users/astrogopher/opt/miniconda3/envs/fsdl-text-recognizer-2021/lib/python3.6/site-packages/torch/serialization.py", line 764, in _legacy_load magic_number = pickle_module.load(f, **pickle_load_args) _pickle.UnpicklingError: invalid load key, 'v'. `