keras_weight_animator
keras_weight_animator copied to clipboard
wisdm.py example
Hi, Nice work on writing the weight animator!
I'm trying to run the wisdm.py example on python 2.7.3 and I get the following error:
traceback (most recent call last):
File "wisdm.py", line 119, in
main()
File "wisdm.py", line 108, in main
model = get_model(batch_size, window_size) # window size of 60 (3 seconds of accelerometer data @ 20hz)
File "wisdm.py", line 92, in get_model
model.Add(Dropout(0.25))
AttributeError: 'Sequential' object has no attribute 'Add'
Please help. Thanks.
As McLawrence said nn.Sequential doesn't have the add method. I think maybe the codes in which you found the using of add could have lines that modified the torch.nn.Module.add to a function like this: def add_module(self,module): self.add_module(str(len(self) + 1 ), module)
torch.nn.Module.add = add_module
after doing this, you can add a torch.nn.Module to a Sequential like you posted in the question. link: https://stackoverflow.com/questions/46141690/how-to-write-a-pytorch-sequential-model/50345328#50345328