simple_tensorflow_serving icon indicating copy to clipboard operation
simple_tensorflow_serving copied to clipboard

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

Open ashutosh199 opened this issue 6 years ago • 2 comments

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'

ashutosh199 avatar Aug 28 '19 07:08 ashutosh199

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

zlszhonglongshen avatar Apr 15 '20 08:04 zlszhonglongshen

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.

tobegit3hub avatar Nov 17 '20 08:11 tobegit3hub