Closed LemonWade closed 10 months ago
I managed to fix it by replacing this line with
np.save(taskvar_dir / f"ep{episode}.npy", np.array(state_dict, dtype=object), allow_pickle=True)
"Following your advice, I have successfully run it. Thank you very much."
For everyone coming back here from the future, please give a shot to our updated data generation scripts.
I encountered an issue in the
__getitem__
method of a dataset processing script. The lineframes.insert(0, 0)
adds an element at position 0, but afterattn_indices = get_attn_indices_from_demo(task, demo, args.cameras)
, there's no further manipulation ofattn_indices
. This discrepancy leads to an error when saving the data usingnp.save(taskvar_dir / f"ep{episode}.npy", state_dict)
. The error message is as follows:ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (5,) + inhomogeneous part.
How can I modify the script to resolve this issue?
The problem seems to arise from inconsistent data shapes within
state_dict
, especially regardingattn_indices
, which does not align with the modifications made to other data sequences in the script. Any suggestions or corrections would be greatly appreciated.