The current error is raised by a linear layer and a shape mismatch.
Based on your screenshot it seems you are still using an object called list, which should also raise the previous error (you are using list.append, so just rename this object to avoid overriding the built-in list).
Also, I’m unsure about the “slicing” of the model as it seems you are appending all layers to modules.
Did you check, if modules contains the wanted layers?
Note that wrapping all child modules in an nn.Sequential container will only add these modules and will skip all functional API calls. For ResNets this flattening opertation will not be included, so I would recommend to use nn.Sequential only for very simple models and verify the new module usage.
PS: you can post code snippets by wrapping them into three backticks ```, which makes debugging easier.