tobegit3hub / simple_tensorflow_serving

Generic and easy-to-use serving service for machine learning models
https://stfs.readthedocs.io
Apache License 2.0
757 stars 192 forks source link

TypeError: a bytes-like object is required, not 'str' #69

Open ashutosh199 opened 5 years ago

ashutosh199 commented 5 years ago

Traceback (most recent call last): File "c:\users\anand\appdata\local\continuum\anaconda3\envs\venv\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "c:\users\anand\appdata\local\continuum\anaconda3\envs\venv\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\anand\AppData\Local\Continuum\anaconda3\envs\venv\Scripts\simple_tensorflow_serving.exe__main__.py", line 5, in File "c:\users\anand\appdata\local\continuum\anaconda3\envs\venv\lib\site-packages\simple_tensorflow_serving\server.py", line 236, in model_name, model_base_path) File "c:\users\anand\appdata\local\continuum\anaconda3\envs\venv\lib\site-packages\simple_tensorflow_serving\scikitlearn_inference_service.py", line 46, in init self.model_base_path) File "c:\users\anand\appdata\local\continuum\anaconda3\envs\venv\lib\site-packages\simple_tensorflow_serving\preprocess_util.py", line 35, in get_preprocess_postprocess_functi on_from_model_path preprocess_function = get_functrion_from_marshal_file(preprocess_file_path) File "c:\users\anand\appdata\local\continuum\anaconda3\envs\venv\lib\site-packages\simple_tensorflow_serving\preprocess_util.py", line 22, in get_functrion_from_marshal_file loaded_function = marshal.loads(preprocess_function_string) TypeError: a bytes-like object is required, not 'str'

zlszhonglongshen commented 4 years ago

@ashutosh199 我也遇到了这个问题,请问解决了吗?

tobegit3hub commented 4 years ago

It seems that you have serialize the preprocess_function as byte object but not UTF string. Please paste more log or your testing script so that we can re-produce your problem.