I can’t reproduce your exact error locally by instantiating a MultiBoxLayer, but you’re using a couple features that we don’t support yet in TorchScript: enumerate() isn’t supported (you can workaround this with for i in range(len(xs)) and getting x with the index), and indexing a nn.ModuleList isn’t supported.
From a first glance it looks like you can get around these by re-writing these parts of your model a little bit (or potentially use the tracing API 13 instead of writing TorchScript directly).