-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Torch Training code for UNet Model #68
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I think this will take a bit of time to review in depth, so I'll do a quick one now on PyTorchUnetTrainSample.xpipes
.
In general I have the philosophy of making things very fast for the users to run, so usually I set almost every inPort to have a default value. I see that you've implemented it already like verbose = self.verbose.value if self.verbose.value else True
, but there are some more that you could provide.
PyTorchUnetTrainSample.xpipes
ImageTrainTestSplit
- 0.8 sounds like a good default split ratio.
CreateUnetModel
- no_epochs -> epochs
- set default values for learning rate, patience, early stop.
- it's kinda odd to see setting the number of epochs in both
CreateUnetModel
and TrainUnet, but I guess it's needed for the early stop?
TrainUnet
- For modelname, I used
filename = Path(sys.argv[0]).stem
so it matches the xpipes name if the user does not provide.
Errors:
ModuleNotFoundError: No module named 'xai_components.xai_torch'
The training.py
still uses the old imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Can confirm the 3 examples work.
Description
Changes made
To Test
To perform the inference code in PyTorchUnetInferenceSample.xpipes. Please put the path that model has be saved as model_path and inference image as image_path.
To perform the model conversion code in ConvertToOnnxSample.xpipes. Please put the pth format model as input_model_path and onnx format path as output_model_path.
Citing Leeds buttefly dataset
Josiah Wang, Katja Markert, and Mark Everingham
Learning Models for Object Recognition from Natural Language Descriptions
In Proceedings of the 20th British Machine Vision Conference (BMVC2009)