PaddlePaddle / PaddleHub

Awesome pre-trained models toolkit based on PaddlePaddle. (400+ models including Image, Text, Audio, Video and Cross-Modal with Easy Inference & Serving)【安全加固,暂停交互,请耐心等待】
https://www.paddlepaddle.org.cn/hub
Apache License 2.0
12.75k stars 2.07k forks source link

PaddleHub U2Net module.py does not have meta=ImageSegmentationModule in the @moduleinfo #2197

Closed szekongchan closed 1 year ago

szekongchan commented 1 year ago

hi, I noticed that the U2Net module.py does not have the meta=SegmentationModule in the @moduleinfo decorator. I believe as a result, we cannot access the training_step method to perform fine tuning of the pre-trained model with our customize images set.

Is this exclusion deliberate or is it a missed-out? Is there any quick way to get around this to continue with the fine-tuning? I had tried changing the downloaded copy at ~/.paddlehub/modules/U2Net/module.py, but it seem that hub.Module(name='U2Net') will detect that the code had been changed and re-download the model https://bj.bcebos.com/paddlehub/paddlehub_dev/U2Net.tar.gz and overwrite the changes..

rainyfly commented 1 year ago

Hi, if you want to modify the module code and load the module with a local path, you can use code

module = hub.Module(directory="your path")