You don’t need to change your current setup, if you create a new virtual environment.
I’m personally using conda, as I think their env setup is convenient to switch quickly and in the worst case, you can just delete a “broken” environment.
download Anaconda
create a new env via: conda create -n my_env_name Python=3.7 Anaconda (the last Anaconda argument pulls in a lot of libs like numpy, matplitlib etc., so you might want to skip it)
C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\container.py in init(self, *args)
51 else:
52 for idx, module in enumerate(args):
—> 53 self.add_module(str(idx), module)
54
55 def _get_item_by_idx(self, iterator, idx):
C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py in add_module(self, name, module)
192 if not isinstance(module, Module) and module is not None:
193 raise TypeError(“{} is not a Module subclass”.format(
→ 194 torch.typename(module)))
195 elif not isinstance(name, torch._six.string_classes):
196 raise TypeError(“module name should be a string. Got {}”.format(
TypeError: torch.nn.modules.activation.ReLU is not a Module subclass
You should be able to see the activation modules, if you’ve created them as modules.
Note that functional API calls won’t be printed in this way, i.e. if you’ve used F.relu() in the forward.
Could this be the case for your model?