hands-on-train-and-deploy-ml icon indicating copy to clipboard operation
hands-on-train-and-deploy-ml copied to clipboard

ModuleNotFoundError during deploy

Open MAGomes95 opened this issue 1 year ago • 2 comments

Dear @Paulescu ,

I have been working on a personal project with the goal of understanding and implementing some of the most relevant concepts on Machine Learning Operations - MLOps. This personal projects is being developed using this repository as inspiration and guideline.

I am currently finishing this project and everything works fine except for the last step - deployment (using cerebrium). During the running of the Makefile - which "implements" deploy - I am facing a ModuleNotFoundError that I do not understand, which follows bellow.

Screenshot from 2024-02-07 20-42-23

As mentioned, I do not understand this error, since the structure of the deployment directory is as follows:

Screenshot from 2024-02-07 20-57-18

Additionaly, I provide my Makefile, so you have more means to understand why I am facing this situation, which besides lots of experimentation I do not understand. I honestly thank you for your time in helping me solve this error and also for the effort of putting together, and free of charge, this project as well all related materials.

Screenshot from 2024-02-07 20-59-05

Thank you.

MAGomes95 avatar Feb 07 '24 21:02 MAGomes95

Hi @MAGomes95 It seems your logger.py file does not get copied to your deployment_dir The prepare-deployment step should copy all your .py files in src to the deployment_dir

Paulescu avatar Mar 03 '24 16:03 Paulescu

Dear @Paulescu ,

Thank you for your response.

In your Makefile, the src directory is copied - as well as its contents - to the deployment_dir, which is exactly what I do.

Bellow, you can see how the src directory in deployment_dir contains logger.py

Screenshot from 2024-03-04 20-34-37

Should I just copy src directory contents to the deployment_dir?

Thank you in advance.

MAGomes95 avatar Mar 04 '24 20:03 MAGomes95