Skip to content

Load Pytorch Model Weights in Python Backend #6108

Answered by hasnainkothawala
maxi-w asked this question in Q&A
Discussion options

You must be logged in to vote

Not sure if I understand you correctly but this how i did it ,

I wrote this in my model.py

def initialize(self, args):
	try:
		self.image_model_path = Path("/mnt/models/detectron-service/1/resources/v1.0/model_final.pth")
		self.image_confidence_threshold = 0.8
		self.detectron_model_weights_file = ("COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml")
		self.detectron2_config = None

And added the model.pth file in the same location :

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dyastremsky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants