Код: Выделить всё
num_features = X_train.shape[1]
feature_map = ZZFeatureMap(feature_dimension=num_features, reps=1)
ansatz = RealAmplitudes(num_qubits=num_features, reps=3)
optimizer = COBYLA(maxiter=100)
vqc = VQC(
feature_map=feature_map,
ansatz=ansatz,
optimizer=optimizer
)
vqc.fit(X_train, y_train.to_numpy())
Код: Выделить всё
MemoryError: Unable to allocate 1.64 GiB for an array with shape (1048576,) and data type
Подробнее здесь: [url]https://stackoverflow.com/questions/79082341/python-throws-memoryerror-while-allocating-a-numpy-array[/url]