locked
Saving and Deploying trained NMT model as a web service RRS feed

  • Question

  • Hi, I am trying to deploy trained NMT model to Azure Model Management but getting the following error while deploying a web service.

    2018-07-16 09:57:40,505 CRIT Supervisor running as root (no user in config file)
    2018-07-16 09:57:40,507 INFO supervisord started with pid 1
    2018-07-16 09:57:41,510 INFO spawned: 'rsyslog' with pid 9
    2018-07-16 09:57:41,511 INFO spawned: 'program_exit' with pid 10
    2018-07-16 09:57:41,512 INFO spawned: 'nginx' with pid 11
    2018-07-16 09:57:41,513 INFO spawned: 'iot' with pid 12
    2018-07-16 09:57:41,515 INFO spawned: 'gunicorn' with pid 13
    2018-07-16 09:57:41,539 INFO success: iot entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
    EdgeHubConnectionString and IOTEDGE_IOTHUBHOSTNAME are not set. Exiting...
    2018-07-16 09:57:41,585 INFO exited: iot (exit status 1; expected)
    2018-07-16 09:57:42,586 INFO success: rsyslog entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
    2018-07-16 09:57:42,586 INFO success: program_exit entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
    2018-07-16 09:57:46,591 INFO success: nginx entered RUNNING state, process has stayed up for > than 5 seconds (startsecs)
    2018-07-16T09:57:46.916122Z, INFO, 00000000-0000-0000-0000-000000000000, , Starting gunicorn 19.6.0
    2018-07-16T09:57:46.916941Z, INFO, 00000000-0000-0000-0000-000000000000, , Listening at: http://127.0.0.1:9090 (13)
    2018-07-16T09:57:46.917074Z, INFO, 00000000-0000-0000-0000-000000000000, , Using worker: sync
    2018-07-16T09:57:46.918072Z, INFO, 00000000-0000-0000-0000-000000000000, , worker timeout is set to 300
    2018-07-16T09:57:46.919071Z, INFO, 00000000-0000-0000-0000-000000000000, , Booting worker with pid: 29
    2018-07-16T09:57:47.271919Z, ERROR, 00000000-0000-0000-0000-000000000000, , Exception in worker process
    Traceback (most recent call last):
      File "/home/mmlspark/lib/conda/lib/python3.5/site-packages/gunicorn/arbiter.py", line 557, in spawn_worker
        worker.init_process()
      File "/home/mmlspark/lib/conda/lib/python3.5/site-packages/gunicorn/workers/base.py", line 126, in init_process
        self.load_wsgi()
      File "/home/mmlspark/lib/conda/lib/python3.5/site-packages/gunicorn/workers/base.py", line 136, in load_wsgi
        self.wsgi = self.app.wsgi()
      File "/home/mmlspark/lib/conda/lib/python3.5/site-packages/gunicorn/app/base.py", line 67, in wsgi
        self.callable = self.load()
      File "/home/mmlspark/lib/conda/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
        return self.load_wsgiapp()
      File "/home/mmlspark/lib/conda/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
        return util.import_app(self.app_uri)
      File "/home/mmlspark/lib/conda/lib/python3.5/site-packages/gunicorn/util.py", line 357, in import_app
        __import__(module)
      File "/var/azureml-app/wsgi.py", line 1, in <module>
        from create_app import create
      File "/var/azureml-app/create_app.py", line 4, in <module>
        from app import main
      File "/var/azureml-app/app.py", line 5, in <module>
        from aml_blueprint import AMLBlueprint
      File "/var/azureml-app/aml_blueprint.py", line 11, in <module>
        import main
      File "/var/azureml-app/main.py", line 6, in <module>
        from nmt_client import init as user_init_func
    ImportError: No module named 'nmt_client'
    
    2018-07-16T09:57:47.273686Z, INFO, 00000000-0000-0000-0000-000000000000, , Worker exiting (pid: 29)
    2018-07-16T09:57:47.314005Z, INFO, 00000000-0000-0000-0000-000000000000, , Shutting down: Master
    2018-07-16T09:57:47.314317Z, INFO, 00000000-0000-0000-0000-000000000000, , Reason: Worker failed to boot.
    2018-07-16 09:57:47,342 INFO exited: gunicorn (exit status 3; not expected)
    2018-07-16 09:57:48,345 INFO spawned: 'gunicorn' with pid 31
    2018-07-16T09:57:53.743089Z, INFO, 00000000-0000-0000-0000-000000000000, , Starting gunicorn 19.6.0
    2018-07-16T09:57:53.743969Z, INFO, 00000000-0000-0000-0000-000000000000, , Listening at: http://127.0.0.1:9090 (31)
    2018-07-16T09:57:53.744096Z, INFO, 00000000-0000-0000-0000-000000000000, , Using worker: sync
    2018-07-16T09:57:53.745103Z, INFO, 00000000-0000-0000-0000-000000000000, , worker timeout is set to 300
    2018-07-16T09:57:53.746095Z, INFO, 00000000-0000-0000-0000-000000000000, , Booting worker with pid: 35
    2018-07-16T09:57:54.029325Z, ERROR, 00000000-0000-0000-0000-000000000000, , Exception in worker process
    Traceback (most recent call last):
      File "/home/mmlspark/lib/conda/lib/python3.5/site-packages/gunicorn/arbiter.py", line 557, in spawn_worker
        worker.init_process()
      File "/home/mmlspark/lib/conda/lib/python3.5/site-packages/gunicorn/workers/base.py", line 126, in init_process
        self.load_wsgi()
      File "/home/mmlspark/lib/conda/lib/python3.5/site-packages/gunicorn/workers/base.py", line 136, in load_wsgi
        self.wsgi = self.app.wsgi()
      File "/home/mmlspark/lib/conda/lib/python3.5/site-packages/gunicorn/app/base.py", line 67, in wsgi
        self.callable = self.load()
      File "/home/mmlspark/lib/conda/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
        return self.load_wsgiapp()
      File "/home/mmlspark/lib/conda/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
        return util.import_app(self.app_uri)
      File "/home/mmlspark/lib/conda/lib/python3.5/site-packages/gunicorn/util.py", line 357, in import_app
        __import__(module)
      File "/var/azureml-app/wsgi.py", line 1, in <module>
        from create_app import create
      File "/var/azureml-app/create_app.py", line 4, in <module>
        from app import main
      File "/var/azureml-app/app.py", line 5, in <module>
        from aml_blueprint import AMLBlueprint
      File "/var/azureml-app/aml_blueprint.py", line 11, in <module>
        import main
      File "/var/azureml-app/main.py", line 6, in <module>
        from nmt_client import init as user_init_func
    ImportError: No module named 'nmt_client'
    
    2018-07-16T09:57:54.031123Z, INFO, 00000000-0000-0000-0000-000000000000, , Worker exiting (pid: 35)
    2018-07-16T09:57:54.075313Z, INFO, 00000000-0000-0000-0000-000000000000, , Shutting down: Master
    2018-07-16T09:57:54.075637Z, INFO, 00000000-0000-0000-0000-000000000000, , Reason: Worker failed to boot.
    2018-07-16 09:57:54,116 INFO exited: gunicorn (exit status 3; not expected)
    2018-07-16 09:57:55,117 INFO gave up: gunicorn entered FATAL state, too many start retries too quickly
    2018-07-16 09:57:56,119 WARN program_exit: bad result line: 'Killing supervisor with this event: ver:3.0 server:supervisor serial:0 pool:program_exit poolserial:0 eventname:PROCESS_STATE_FATAL len:58'
    2018-07-16 09:57:56,119 WARN program_exit: has entered the UNKNOWN state and will no longer receive events, this usually indicates the process violated the eventlistener protocol
    2018-07-16 09:57:56,119 WARN received SIGQUIT indicating exit request
    2018-07-16 09:57:56,119 INFO waiting for nginx, rsyslog, program_exit to die
    2018-07-16 09:57:57,123 INFO stopped: nginx (exit status 0)
    2018-07-16 09:57:57,123 INFO stopped: program_exit (terminated by SIGTERM)
    2018-07-16 09:57:57,125 INFO stopped: rsyslog (exit status 0)
    

    Monday, July 16, 2018 11:51 AM

Answers

  • It looks like you haven't installed nmt_client (No module named 'nmt_client') so the import statement is failing. Please include that in your dependencies.yml file so it is installed in the container before it can be used.

    Thanks,

    Raymond

    Thursday, July 26, 2018 5:19 PM