The TypeError: __init__() takes exactly 1 argument (2 given) error came from model = nn.Sequential(modules), when I tried your solution.
But I don’t think the ReLU layers are being detected: https://gist.github.com/ProGamerGov/f735c1360207b420c4f920d69853e157#file-test2-py-L105 1
For whatever reason, it looks like if isinstance(layer, nn.ReLU): never detects a ReLU layer.