简体   繁体   中英

Failed to start server error when trying run docker using the tensorflow/serving image

I am using the tensorflow/serving image and run into this error trying run the docker file.

Step 1: > pulled the tensorflow serving image

docker pull tensorflow/pull

Step2: Stored my models into a (saved-models) folder within my project folder(detection-potato-lite)

Elijah-A-W@DESKTOP-34M2E8U MINGW64 /d/myn/ML_Prediction_Project/New_folder/detection-potato-lite
$ ls
   Api/  'Data Eda'/   models.config   Plant/   saved-models/

Step 3: Created the models.config file in the Project folder to render the models dynamically using tensorflow serving

    model_config_list {
    config {
        name: 'potatoes_model'
        base_path: '/detection-potato-lite/saved-models'
        model_platform: 'tensorflow'
        model_version_policy: {all: {}}
}

Step4: Get an error(No such file/directory) when trying run the image in Windows Powershell

PS C:\Users\Elijah-A-W> docker run -t --rm -p 8501:8501 -v D:/myn/ML_Prediction_Project/New_Folder/detection-potato-lite:/detection-potato-disease tensorflow/serving --rest_api_port=8501 --model_config_file=/detection-potato-lite/models.config

Failed to start server. Error: Not found: /detection-potato-lite/models.config; No such file or directory

I see two problems here:

  1. The directory path you bind to the volume is different to the one you list locally (New_Folder vs New_folder)
  2. You bind local directory 'detection-potato-lite' to docker directory 'detection-potato-disease'. When you specify the location of the config file and base-path for your application to run in docker, it must be relative to where you store it in docker so it will be 'detection-potato-disease'.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM