matthew-sochor-zz / fish.io.ai

Krillin' it since 2017
MIT License
4 stars 3 forks source link

fix bug in model server logging #43

Closed thenomemac closed 7 years ago

thenomemac commented 7 years ago
   msg = self.format(record)
  File "/home/fishioai/miniconda3/envs/fishr/lib/python3.6/logging/__init__.py", line 838, in format
    return fmt.format(record)
  File "/home/fishioai/miniconda3/envs/fishr/lib/python3.6/logging/__init__.py", line 575, in format
    record.message = record.getMessage()
  File "/home/fishioai/miniconda3/envs/fishr/lib/python3.6/logging/__init__.py", line 338, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "/home/fishioai/miniconda3/envs/fishr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/fishioai/miniconda3/envs/fishr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/fishioai/fish.io.ai/fishr/score_fish_pic.py", line 76, in <module>
    model_serve_from_queue(file_path)
  File "/home/fishioai/fish.io.ai/fishr/score_fish_pic.py", line 68, in model_serve_from_queue
    predict(*fish_pic_to_score)
  File "/home/fishioai/fish.io.ai/fishr/score_fish_pic.py", line 52, in predict
    log.info('predicted class:', cat_from_int(np.argmax(y_pred)))
Message: 'predicted class:'
Arguments: ('walleye',)
INFO:root:------------------------------
DEBUG:root:Commited update to db: 8
thenomemac commented 7 years ago

Done. Solution use logging vs print