Commented out the line that does weight initialization for Nemo. Changed the decoder layers from a single 1d conv to 1dconv->relu->1dconv. When I call change_vocabulary however, my decoder doesn’t change.Įxactly what I did is below, any ideas? Step 1: Create Neural ModuleĪll I changed here is A. Thus, if you use an nn.Sequential the output you get in the hook is only the final result and you have no option the retrieve the intermediate ones. The hook will be called every time after forward() has computed an output. I see that in Hydra 1.1 cls is replaced with _target_ in the config files, so I followed your instructions but for step 2 I changed to the classpath of my new decoder. I dont think registerforwardhook() will help you here. I started with code from the ASR with NeMo tutorial and they appear to use Hydra 1.0. I’m trying it now but am running into some issues setting the config. If NVIDIA docker image is used you don’t need to specify these. Even if I load up quartznet and manually overwrite the decoder, then try to load the saved checkpoint, it fails because it seems to be using the config file behind the scenes.Įnvironment overview (please complete the following information)Ĭolab using nemo-toolkit=1.0.0b1 and config from We are giving the code to build the network in the usual way, and you are going to write the code for the same network using sequential modules. I have no idea how to update the config file to use my new decoder, or how to bypass the config file altogether, and couldn’t find a way to do so in the docs. Having learned about the sequential module, now is the time to see how you can convert a neural network that doesn't use sequential modules to one that uses them. This is because my underlying config file still specifies the decoder as being from the class .ConvASRDecoder. Size mismatch for coder_layers.0.bias: copying a param with shape torch.Size() from checkpoint, the shape in current model is torch.Size(). Size mismatch for coder_layers.0.weight: copying a param with shape torch.Size() from checkpoint, the shape in current model is torch.Size(). Unexpected key(s) in state_dict: "coder_layers.2.weight", "coder_layers.2.bias". This worked and it trains well, but when I save the model and try to load it, I get the following error: RuntimeError: Error(s) in loading state_dict for EncDecCTCModel: The sequence imposes an order on the observations that must be preserved when training models and making predictions. I did so by overriding _layers with my own nn.Sequential using the code below _layers = nn.Sequential(nn.Conv1d(1024, 256, kernel_size=1, stride=1), nn.ReLU(), nn.Conv1d(256, 41, kernel_size=1, stride=1)) Sequence prediction is different from other types of supervised learning problems. I would like to implement my own decoder for transfer learning to experiment with multiple linear layers.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |