1 Error description
1.1 System Environment
ardware Environment(Ascend/GPU/CPU): CPU
Software Environment:
– MindSpore version (source or binary): 1.6.0
– Python version (eg, Python 3.7.5): 3.7.6
– OS platform and distribution (eg, Linux Ubuntu 16.04): Ubuntu 4.15.0-74-generic
– GCC/Compiler version (if compiled from source):
1.2 Basic information
1.2.1 Script
This case customizes the dataset and performs batch operations.
1.2.2 Error reporting
RuntimeError: Unexpected error. Inconsistent batch shapes, batch operation expect same shape for each data row, but got inconsistent shape in column 0, expected shape for this column is:, got shape:
2 Reason analysis
According to the error message, the batch operation needs to input the same shape of the dataset, but the shape of the custom dataset is not uniform, resulting in an error.
3 Solutions
1. Remove the batch operation.
2. If you must perform batch operations on data with inconsistent shapes, you need to organize the data set and unify the shape of the input data through pad completion and other methods.
Read More:
- [Solved] MindSpore Error: “RuntimeError: Unable to data from Generator..”
- [Solved] MindSpore Error: “RuntimeError: Invalid data, Page size.”
- [Solved] RuntimeError: each element in list of batch should be of equal size
- MindSpore Error: [ERROR] MD:unexpected error.Not a valid index
- Win10 remote connection submits error by using cluster: Batch: error: batch script contains DOS line breaks (\R\n) sbatch: error
- [Solved] MindSpore Error: “TypeError: parse() missing 1 required positional.”
- [Solved] MindSpore Error: “GeneratorDataset’s num_workers=8, this value is …”
- [Solved] MindSpore Error: Should not use Python in runtime
- [Solved] MindSpore Error: “ValueError:invalid literal for int()with base10’the’
- [Solved] MindSpore Error: Select GPU kernel op * fail! Incompatible data type
- [Solved] MindSpore Error: ValueError: For ‘AvgPool’ every dimension of the output shape must be greater than zero
- [Solved] MindSpore Error: For ‘MirrorPad‘, paddings must be a Tensor with *
- [Solved] MindSpore Error: ValueError: `padding_idx` in `Embedding` out of range
- [Solved] MindSpore infer error when passing in sens values for derivation: For ‘MatMul’, the input dimensions
- [Solved] MindSpore Error: task_fail_info or current_graph_ is nullptr
- [Solved] MindSpore Error: ReduceMean in the Ascend environment does not support inputs of 8 or more dimensions
- [Solved] MindSpore Error: `half_pixel_centers`=True only support in Ascend
- [Solved] MindSpore Error: TypeError: For ‘TopK’, the type of ‘x’ should be…
- [Solved] MindSpore Error: Data type conversion of ‘Parameter’ is not supporte