Closed abhishekdey001 closed 1 year ago
Hi, simply comment out the assert
line should work.
Upon commenting the assert line, I am getting the following error
2023-07-12 21:05:19,749 [trainer.py] => init_epochs: 5
2023-07-12 21:05:19,749 [trainer.py] => init_lr: 0.1
2023-07-12 21:05:19,749 [trainer.py] => init_weight_decay: 0.0005
2023-07-12 21:05:19,749 [trainer.py] => expansion_epochs: 3
2023-07-12 21:05:19,749 [trainer.py] => fusion_epochs: 2
2023-07-12 21:05:19,749 [trainer.py] => lr: 0.1
2023-07-12 21:05:19,749 [trainer.py] => batch_size: 4
2023-07-12 21:05:19,749 [trainer.py] => weight_decay: 0.0005
2023-07-12 21:05:19,749 [trainer.py] => num_workers: 8
2023-07-12 21:05:19,749 [trainer.py] => input_size: 256
2023-07-12 21:05:19,749 [trainer.py] => T: 2
2023-07-12 21:05:19,822 [data_manager.py] => [6, 10, 8, 2, 4, 13, 11, 5, 7, 0, 3, 12, 14, 9, 1]
2023-07-12 21:05:19,841 [trainer.py] => All params: 0
2023-07-12 21:05:19,841 [trainer.py] => Trainable params: 0
2023-07-12 21:05:19,866 [beef_iso.py] => Learning on 0-9
2023-07-12 21:05:19,867 [beef_iso.py] => All params: 465324
2023-07-12 21:05:19,867 [beef_iso.py] => Trainable params: 465324
0%| | 0/5 [00:03<?, ?it/s]
Traceback (most recent call last):
File "main.py", line 31, in <module>
main()
File "main.py", line 12, in main
train(args)
File "/home/developer/trainer.py", line 18, in train
_train(args)
File "/home/developer/trainer.py", line 65, in _train
model.incremental_train(data_manager)
File "/home/developer/models/beef_iso.py", line 105, in incremental_train
self._train(self.train_loader, self.test_loader,self.val_loader)
File "/home/developer/models/beef_iso.py", line 134, in _train
self._init_train(train_loader, test_loader, optimizer, scheduler)
File "/home/developer/models/beef_iso.py", line 193, in _init_train
logits = self._network(inputs)["logits"]
File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1131, in _call_impl
return forward_call(*input, **kwargs)
File "/home/developer/utils/inc_net.py", line 676, in forward
out = fc(features)
File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1131, in _call_impl
return forward_call(*input, **kwargs)
File "/home/developer/convs/linears.py", line 32, in forward
return {'logits': F.linear(input, self.weight, self.bias)}
RuntimeError: mat1 and mat2 shapes cannot be multiplied (4x3136 and 64x9)
root@5a323a380665:/home/developer#
Upon commenting the assert line, I am getting the following error
2023-07-12 21:05:19,749 [trainer.py] => init_epochs: 5 2023-07-12 21:05:19,749 [trainer.py] => init_lr: 0.1 2023-07-12 21:05:19,749 [trainer.py] => init_weight_decay: 0.0005 2023-07-12 21:05:19,749 [trainer.py] => expansion_epochs: 3 2023-07-12 21:05:19,749 [trainer.py] => fusion_epochs: 2 2023-07-12 21:05:19,749 [trainer.py] => lr: 0.1 2023-07-12 21:05:19,749 [trainer.py] => batch_size: 4 2023-07-12 21:05:19,749 [trainer.py] => weight_decay: 0.0005 2023-07-12 21:05:19,749 [trainer.py] => num_workers: 8 2023-07-12 21:05:19,749 [trainer.py] => input_size: 256 2023-07-12 21:05:19,749 [trainer.py] => T: 2 2023-07-12 21:05:19,822 [data_manager.py] => [6, 10, 8, 2, 4, 13, 11, 5, 7, 0, 3, 12, 14, 9, 1] 2023-07-12 21:05:19,841 [trainer.py] => All params: 0 2023-07-12 21:05:19,841 [trainer.py] => Trainable params: 0 2023-07-12 21:05:19,866 [beef_iso.py] => Learning on 0-9 2023-07-12 21:05:19,867 [beef_iso.py] => All params: 465324 2023-07-12 21:05:19,867 [beef_iso.py] => Trainable params: 465324 0%| | 0/5 [00:03<?, ?it/s] Traceback (most recent call last): File "main.py", line 31, in <module> main() File "main.py", line 12, in main train(args) File "/home/developer/trainer.py", line 18, in train _train(args) File "/home/developer/trainer.py", line 65, in _train model.incremental_train(data_manager) File "/home/developer/models/beef_iso.py", line 105, in incremental_train self._train(self.train_loader, self.test_loader,self.val_loader) File "/home/developer/models/beef_iso.py", line 134, in _train self._init_train(train_loader, test_loader, optimizer, scheduler) File "/home/developer/models/beef_iso.py", line 193, in _init_train logits = self._network(inputs)["logits"] File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1131, in _call_impl return forward_call(*input, **kwargs) File "/home/developer/utils/inc_net.py", line 676, in forward out = fc(features) File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1131, in _call_impl return forward_call(*input, **kwargs) File "/home/developer/convs/linears.py", line 32, in forward return {'logits': F.linear(input, self.weight, self.bias)} RuntimeError: mat1 and mat2 shapes cannot be multiplied (4x3136 and 64x9) root@5a323a380665:/home/developer#
If you are training the model with your specific data, I think the encoder should also be redesigned. This error seems to indicate that the embedding dimension cannot be matched between the encoder and the fully connected layer (fc).
Hi I would like to know what changes are required for implementing the different CIL methods on custom dataset. I tried to add a custom dataset class in
utils/data.py
. However I am getting assertion error.AssertionError: