Closed Edfame closed 2 years ago
You need to ask the init_from_nemo_model to exclude the decoder part. Please take a look here: https://github.com/NVIDIA/NeMo/blob/c15ed0469a908c3bdda859089437ecb8db845cff/nemo/core/classes/modelPT.py#L948 Currently the init_from_pretrained_model does not support it but I am going to add it next week. For now, you can download the nemo file and use init_from_nemo_model instead.
You should use something like this in the config:
init_from_nemo_model:
model0:
path:"QuartzNet15x5Base-En.nemo"
exclude: ["decoder"]
You need to ask the init_from_nemo_model to exclude the decoder part. Please take a look here: Currently the init_from_pretrained_model does not support it but I am going to add it next week. For now, you can download the nemo file and use init_from_nemo_model instead.
Oh okay, I thought about doing that for the init_from_pretrained_model
but I didn't see how to do it in the code comments, but makes sense since it is not implemented yet! 😄
When implemented the config will be more or less the same (?) , something like:
init_from_pretrained_model:
model0:
name: "QuartzNet15x5Base-En"
exclude: ["decoder"]
PS: Will this issue be mentioned on the release where this is implemented? Just so I know when to rebuild my docker images :)
The changelog would have some pr detail wrt this issue, but it won't be available till Nemo 1.9 (1.5 months from now) you could kinda sidestep that by copy pasting and writing your own method since it's simple enough in the meanwhile without waiting for us
I'll either implement that snippet of code (which, as you said, sounds simple) or use every transfer model as .nemo files until the 1.9 comes out with that feature implemented.
Thanks very much for the support 😉
Hello! 👋🏻
I'm trying to implement a script which allows me to train models from scratch or to use pre-trained ones (.nemo files or from the cloud) accordingly to the given config file. The goal here is to either train models for the European Portuguese language from scratch, to transfer from the pre-trained English to European Portuguese, or to transfer other Portuguese models (trained from scratch), e.g. trained with Brazilian Portuguese, to other European Portuguese.
I've seen this example and it is the one that I'm trying to replicate, but since my Portuguese labels (41) differ in size from the english ones (29) it gives me the following error:
I'm setting up the field
init_from_pretrained_model
field in the config file (can see it below) to"QuartzNet15x5Base-En"
and I intend to change it toinit_from_nemo_model: "MyModel.nemo"
in the other mentioned cases.Is there any way I can make this without having to reccour to the
.change_vocabulary()
,.setup_training_data()
,.setup_validation_data()
and.setup_test_data()
functions?Code:
Config: