Open forhonourlx opened 5 years ago
Hi Puyu, Thank you. But nn.LSTM(batch_first=True) still returns a tuple.
File "C:\Users\simon\Desktop\DeepRL.old\deep_rl\agent\PPO_agent.py", line 25, in init
torchsummary.summary(self.network,(100, 2, 11))
File "C:\Anaconda\lib\site-packages\torchsummary\torchsummary.py", line 89, in summary
model(x)
File "C:\Anaconda\lib\site-packages\torch\nn\modules\module.py", line 489, in call
result = self.forward(input, *kwargs)
File "C:\Users\simon\Desktop\DeepRL.old\deep_rl\network\network_heads.py", line 173, in forward
phi = self.network.phi_body(obs)
File "C:\Anaconda\lib\site-packages\torch\nn\modules\module.py", line 489, in call
result = self.forward(input, **kwargs)
File "C:\Users\simon\Desktop\DeepRL.old\deep_rl\network\network_bodies.py", line 149, in forward
y, (h_n,c_n) = self.lstm1(x)#(torch.Size([22, 8]), torch.Size([22, 8])), (torch.Size([1, 2, 8]), torch.Size([1, 2, 8]))
File "C:\Anaconda\lib\site-packages\torch\nn\modules\module.py", line 491, in call
hook_result = hook(self, input, result)
File "C:\Anaconda\lib\site-packages\torchsummary\torchsummary.py", line 37, in hook
[-1] + list(o.size())[1:] for o in output
File "C:\Anaconda\lib\site-packages\torchsummary\torchsummary.py", line 37, in
Hi, I think that you don't replace this version of pytorch-summary to Bond-SYSU/pytorch-summary successfully.When I do this,this error doesn't appear.Have a try!
Hi, I actually have the exact same error with lstm and torchsummary and replacing the version didn't help. any ideas on how to solve this?
I couldn't pass multiple inputs to Bond-SYSU version.
Using SummaryX solved my probelm
Using SummaryX solved my probelm
Can you please share the link? Because I either get the error mentioned above or "input must have 3 dimensions, got 4".
Using SummaryX solved my probelm
Very helpful answer! It works nicely now!
Using SummaryX solved my probelm
Thank you very much!!!
File "C:\Users\simon\Desktop\DeepRL.old\deep_rl\agent\PPO_agent.py", line 25, in init torchsummary.summary(self.network,(100, 2, 11)) ...... File "C:\Users\simon\Desktop\DeepRL.old\deep_rl\network\network_bodies.py", line 149, in forward y, (h_n,c_n) = self.lstm1(x) File "C:\Anaconda\lib\site-packages\torch\nn\modules\module.py", line 491, in call hook_result = hook(self, input, result) File "C:\Anaconda\lib\site-packages\torchsummary\torchsummary.py", line 23, in hook [-1] + list(o.size())[1:] for o in output File "C:\Anaconda\lib\site-packages\torchsummary\torchsummary.py", line 23, in
[-1] + list(o.size())[1:] for o in output
AttributeError: 'tuple' object has no attribute 'size'
where: self.lstm1 = nn_init(nn.LSTM(input_size=self.trace_length, hidden_size=self.n_lstm_units,batch_first=True))