Advertisement
KDLPro

Error 3

Apr 26th, 2024 (edited)
932
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.85 KB | None | 0 0
  1. ---------------------------------------------------------------------------
  2. RuntimeError                              Traceback (most recent call last)
  3. Cell In[18], line 7
  4.       5 for data_seq in tqdm(data_loader_train, total=len(data_loader_train), desc="Training", leave=False):
  5.       6     buffer = torch.zeros(data_seq.shape[0], buffer_size, device=device)
  6. ----> 7     summary(gps_rnn, [(32,14,2), buffer])
  7.  
  8. File D:\ProgramData\Miniconda_3.9\envs\rnn-sample-py3.9\lib\site-packages\torchsummary\torchsummary.py:136, in summary(model, input_data, batch_dim, branching, col_names, col_width, depth, device, dtypes, verbose, *args, **kwargs)
  9.     133 if device is None:
  10.     134     device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
  11. --> 136 x, input_size = process_input_data(input_data, batch_dim, device, dtypes)
  12.     137 args, kwargs = set_device(args, device), set_device(kwargs, device)
  13.     138 try:
  14.  
  15. File D:\ProgramData\Miniconda_3.9\envs\rnn-sample-py3.9\lib\site-packages\torchsummary\torchsummary.py:215, in process_input_data(input_data, batch_dim, device, dtypes)
  16.     213         if dtypes is None:
  17.     214             dtypes = [torch.float] * len(input_data)
  18. --> 215         input_size = get_correct_input_sizes(input_data)
  19.     216         x = get_input_tensor(input_size, batch_dim, dtypes, device)
  20.     218 else:
  21.  
  22. File D:\ProgramData\Miniconda_3.9\envs\rnn-sample-py3.9\lib\site-packages\torchsummary\torchsummary.py:261, in get_correct_input_sizes(input_size)
  23.     258         else:
  24.     259             yield item
  25. --> 261 if not input_size or any(size <= 0 for size in flatten(input_size)):
  26.     262     raise ValueError("Input_data is invalid, or negative size found in input_data.")
  27.     264 if isinstance(input_size, list) and isinstance(input_size[0], int):
  28.  
  29. RuntimeError: Boolean value of Tensor with more than one value is ambiguous
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement