In this case, you can also find batch_ When the size is 1, no error will be reported,
batch_ If the size is greater than 1, an error will be reported because the dimensions of entries in the same batch are different
For example, batch = [[2,3,5,1], [3,4,5,2,3]]
Solution:
Make up to the same length
# Complement the length of all vectors to max_length multi = np.pad(multi, (0, max_length-multi.shape[0]), 'constant', constant_values=(0, 0))
Note that in the dataset class__get__Supplement in item() method
Similar Posts:
- [Solved] error: missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS
- [Solved] ant Error: Cannot use ‘in’ operator to search for ‘value’ in undefined
- Solution to the problem of “TypeError: Assignment to constant variable”
- [Solved] tf.summary Error: tags and values not the same shape
- tf.data.Dataset.from_tensor_slices: How to Use shuffle(), repeat(), batch()
- [leetcode] 140. Word break II word split II
- ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
- [Solved] MySQL Add New Field Error: ERROR 1118 — Row size too large. The maximum row size for the used table type
- cannot simultaneously fetch multiple bags
- [leetcode] 280. Wiggle sort