i’m sorry, i’m new in pytorch, try to learn to load the dataset. but have a trouble with it.
i have numpy data in pandas (from speech), how to load it to pytorch?
my data in pandas looks like this:
array([array([[-0.00027978],
       [-0.00027978],
       [-0.00027978],
       ...,
       [ 0.02842325],
       [ 0.02795309],
       [ 0.03359528]], dtype=float32),
       array([[ 0.00029535],
       [ 0.00029535],
       [ 0.00029535],
       ...,
       [ 0.00383177],
       [ 0.00245112],
       [-0.00314868]], dtype=float32)], dtype=object)

it’s a data series…
error when try to make it as tensor dataset, the error is:
train_set = TensorDataset(torch.from_numpy(np.array(train_pd.segmentasi.values)))
TypeError: can't convert np.ndarray of type numpy.object_. The only supported types are: float64, float32, float16, int64, int32, int16, int8, uint8, and bool.
i think similar with the other question, but when i try to follow, nothing works for me…
already read many question that maybe related, got the clue like this:
np.array((train_pd.segmen.values).tolist())
so, i make:
train_set = TensorDataset(torch.from_numpy(np.array(train_pd.segmentasi.values).tolist())))
still fail, because the array type become an object again.
then,try to set the dtype with:
np.array((train_pd.segmen.values).tolist(),dtype=np.float32)
with command:
train_set = TensorDataset(torch.from_numpy(np.array((train_pd.segmentasi.values).tolist(),dtype=np.float32)))
back error, but this time said:
ValueError: setting an array element with a sequence
please…trully need an advice,  the king of novice with numpy and torch.
about the data, i already try to plot it with matplotlib, and it show picture of waveform, so i think the data is fine:
#test the data
segment_data = train_pd['segment'][2]
print(len(segment_data))

# show segmentation
plt.plot(segment_data)
plt.show()

156500