When model outputs a single tensor, this line gets len(outputs_batch) equal to first dimension of the tensor, but it should be 1. On the other hand if model outputs a list with one tensor: [x,], then this line gets outputs_batch as a list, but it expects this variable to be a tensor, so the code breaks. Please fix it, because it is impossible to work with such cases.
The same thing occurs when you try to validate your model here. Code expects outputs to be a tensor, and if it's a list, code breaks.
When model outputs a single tensor, this line gets
len(outputs_batch)
equal to first dimension of the tensor, but it should be 1. On the other hand if model outputs a list with one tensor:[x,]
, then this line getsoutputs_batch
as a list, but it expects this variable to be a tensor, so the code breaks. Please fix it, because it is impossible to work with such cases.The same thing occurs when you try to validate your model here. Code expects outputs to be a tensor, and if it's a list, code breaks.