AttributeError: 'Net' object has no attribute 'module'

If you want to get the state of the whole network, you should use net.state_dict().

If you just want to get the state of a specific sub-module, you should use the sub-module name like net.sub_module_name.state_dict().

2 Likes