Question about Optuna on own pipeline with segmentation model
See original GitHub issuehi, @juanmc2005 sorry for bothering you! as title, I want to use optuna to tuning parameters, and the segmentation model used in pipeline is my own trained follow training_a_model.ipynb. And i have already saved in “ckpt” format when i followed the “Custom models” part, try to define own segmentation model like
class MySegmentationModel(SegmentationModel):
def __init__(self):
super().__init__()
self.my_pretrained_model = torch.load("./epoch=0-step=69.ckpt") **<- put my own ckpt here**
def __call__(
self,
waveform: torch.Tensor,
weights: Optional[torch.Tensor] = None
) -> torch.Tensor:
return self.my_pretrained_model(waveform, weights)
then, i redefine the config like
config = PipelineConfig(segmentation=MySegmentationModel())
optimizer = Optimizer(benchmark, config, hparams, p)
it comes out the error shown as below
then i trace back, and it seems that it can detect duration, sample rate, or sth could you tell me how to fix these problems or I can’t use my segmentation model in optuna?
I want to do this because i guess the parameter will be affected in different model, so i want to give it a try
Thanks for your awesome work and help!!! expected your response!
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Hi @juanmc2005 i finally understand what u mean!! thanks a lot!!
Hi @Shoawen0213,
You shouldn’t modify
pipelines.py
for this, you can just pass your ownPipelineConfig
object toOnlineSpeakerDiarization
. If you are runningdiart.tune
and not using the python API (which I think is your case) and you’re also running version 0.5.1, then you should be able to do:Concerning the documentation, I’m writing it as a GitHub wiki. There’s a “wiki” tab in the repo’s main page. I still need to add a link from the README so it’s harder to miss 😃