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

Could not find directory - Windows 10 and pip install #51

Closed windowshopr closed 5 years ago

windowshopr commented 5 years ago

After running the pip install, I try running the suggested command and receive this error:

C:\Users\windowshopr>simple_tensorflow_serving --model_base_path="./models/tensorflow_template_application_model"
2019-05-14 23:06:28 INFO     bind: 0.0.0.0:8500
2019-05-14 23:06:28 INFO     host: 0.0.0.0
2019-05-14 23:06:28 INFO     port: 8500
2019-05-14 23:06:28 INFO     enable_ssl: False
2019-05-14 23:06:28 INFO     secret_pem: secret.pem
2019-05-14 23:06:28 INFO     secret_key: secret.key
2019-05-14 23:06:28 INFO     model_name: default
2019-05-14 23:06:28 INFO     model_base_path: ./models/tensorflow_template_application_model
2019-05-14 23:06:28 INFO     model_platform: tensorflow
2019-05-14 23:06:28 INFO     model_config_file:
2019-05-14 23:06:28 INFO     reload_models: False
2019-05-14 23:06:28 INFO     custom_op_paths:
2019-05-14 23:06:28 INFO     session_config: {}
2019-05-14 23:06:28 INFO     debug: False
2019-05-14 23:06:28 INFO     log_level: info
2019-05-14 23:06:28 INFO     gen_client:
2019-05-14 23:06:28 INFO     enable_auth: False
2019-05-14 23:06:28 INFO     auth_username: admin
2019-05-14 23:06:28 INFO     auth_password: admin
2019-05-14 23:06:28 INFO     enable_colored_log: False
2019-05-14 23:06:28 INFO     enable_cors: True
2019-05-14 23:06:28 INFO     download_inference_images: True
Traceback (most recent call last):
  File "c:\users\windowshopr\appdata\local\programs\python\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\windowshopr\appdata\local\programs\python\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\windowshopr\AppData\Local\Programs\Python\Python36\Scripts\simple_tensorflow_serving.exe\__main__.py", line 5, in <module>
  File "c:\users\windowshopr\appdata\local\programs\python\python36\lib\site-packages\simple_tensorflow_serving\server.py", line 252, in <module>
    session_config)
  File "c:\users\windowshopr\appdata\local\programs\python\python36\lib\site-packages\simple_tensorflow_serving\tensorflow_inference_service.py", line 70, in __init__
    model_versions = self.get_all_model_versions()
  File "c:\users\windowshopr\appdata\local\programs\python\python36\lib\site-packages\simple_tensorflow_serving\tensorflow_inference_service.py", line 315, in get_all_model_versions
    model_versions = tf.gfile.ListDirectory(self.model_base_path)
  File "c:\users\windowshopr\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 482, in list_directory
    raise errors.NotFoundError(None, None, "Could not find directory")
tensorflow.python.framework.errors_impl.NotFoundError: Could not find directory

Any ideas?

tobegit3hub commented 5 years ago

It may be the problem to find the model files in ./models/tensorflow_template_application_model. Can you change to the path in Windows such as c:\\models\tensorflow_template_application_model ?

windowshopr commented 5 years ago

Thanks for the tip,

I noticed that after the error message, it was changing the directory to "c://users/windowshopr/" so I put the models folder in that directory and it works now. Thanks!

tobegit3hub commented 5 years ago

Great. Thanks @windowshopr .

ashbeats commented 5 years ago

@tobegit3hub

how did you install it on windows via pip?

The pip install always failed at uwsgi, which i thought was expected since uwsgi does not support windows.