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):

It seems that your module/sequential contains ‘dict’ object and that can not be automatically interpreted into pytorch layers, so you need to check your model structure.