Str is not a Module subclass

Here is the error below:

I am not able to understand the error. I am a beginner in this and it would be really helpful if someone could assist me with this.

It seems that the error occurs in your module, could you confirm the type of your module?

By this:

for i, module in enumerate(modules):
    print(torch.typename(module))