Can i make my pytorch model to docker image?

I want to pack my model to docker image.
Cause i’m beginner in domain of docker, i just know one solution - make a REST API server with pytorch model and make it as docker image. Then, when use this docker server, send request to train or test model.
Is there other options??

Thank you

That workflow is similar to how torchserve users have deployed a model in the past, check it out and lemme know if you have any questions but this should make it easy to take a trained model, serve it from within a container and expose an HTTP endpoint that users can query against

If you’re looking at packaging a model in Docker file for training

Then in your Dockerfile you need to ADD directory_with_data_and_code and then RUN python would be an easy start