MMS Docker image insists on working directory being mxnet-model-server
I wrote a small NLP app and (attempted to) deploy it using the official MMS Docker image.
I exported the model into a /model directory in the container. However, when I tried to launch MMS, it complained about not being able to find the artifacts (the symbol file, for example). I could get it to work only when I put all the artifacts (the *symbol.json file, the params file, and the signature) in the same directory as mxnet-model-server.
I cannot imagine that this is by design. What did I do wrong?
Thanks for submitting the issue. Will looking into it.
@samirbajaj : We would like to understand your scenario a little better. What service file are you using? How are you providing the symbol to load_checkpoint? the issue could be that the custom service file you have is not using the "model_dir"
https://github.com/awslabs/mxnet-model-server/blob/master/mms/model_service/mxnet_model_service.py#L99
If this isn't the case, could you share how you are providing models in the mms_app.conf file?
- The service file is custom ... i.e., it is a subclass of
MXNetBaseService - The load_checkpoint call is as follows:
sym, arg_params, aux_params = mx.model.load_checkpoint(self.model_name, self.epoch_num)
self.mod = mx.mod.Module(symbol=sym, context=mx.gpu(0))
self.mod.bind(for_training=False, data_shapes=[('data', (1, 20))], label_shapes=[('softmax_label', (1, ))])
self.mod.set_params(arg_params, aux_params, allow_missing=True, allow_extra=True)
And here's the mms_app_gpu.conf:
[MMS Arguments]
--models
sentiment=/models/sentiment.model
Note that it's really all the artifacts that need to be in the mxnet-model-server directory ... not just the service file.
Thank you for responding.
@samirbajaj : The service file is passed a "model_dir" ... From the code snippet you posted, I don't see you appending "model_dir" to the model_name. You would need to do that for the service file to find artifacts in the "/model/*" directory. You could search for "model_dir" in the following file (https://github.com/awslabs/mxnet-model-server/blob/master/mms/model_service/mxnet_model_service.py#L62) . Do let us know if this doesn't solve the issue...
Thank you ... that was indeed the issue.