JIT trace model with ModuleList error

You are copying the BasicConv layer by using

[BasicConv(...)] * 8

which will result of 8 identical layers (same parameters, same id).
If you would like to initialize 8 different layers, use:

self.leach = nn.ModuleList([BasicConv(
            256+512,
            128,
            kernel_size=(1, 1), stride=(1, 1)) for _ in  range(8)])
1 Like