-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
size error #273
Comments
Try https://github.com/mit-han-lab/torchquantum/tree/main/examples/quanvolution (with #147 to increase accuracy); I’ll ask about updating the link! |
thank you, it worked |
Define transformations for the datasettransform = transforms.Compose([ Load your datasetdata_dir = 'OAM28' # Replace with the path to your dataset Split dataset into train and testtrain_size = int(0.9 * len(full_dataset)) Create data loadersbatch_size = 16 dataflow = {'train': train_loader, 'test': test_loader} |
Hello, do you have a follow up? Happy to help but am a bit unsure what you are asking! |
when i tried to run the example from the youtube video "https://www.youtube.com/watch?v=-Grfxkg3-DI" I got this error when I try to run the training cell
Epoch 1:
RuntimeError Traceback (most recent call last)
in <cell line: 46>()
47 # train
48 print(f"Epoch {epoch}:")
---> 49 train(dataflow, model, device, optimizer)
50 print(optimizer.param_groups[0]['lr'])
51
13 frames
/content/torchquantum/torchquantum/functional/gate_wrapper.py in apply_unitary_bmm(state, mat, wires)
129 if len(mat.shape) > 2:
130 # both matrix and state are in batch mode
--> 131 new_state = mat.bmm(permuted)
132 else:
133 # matrix no batch, state in batch mode
RuntimeError: Expected size for first two dimensions of batch2 tensor to be: [10, 2] but got: [1, 2].
i didn't change anything
The text was updated successfully, but these errors were encountered: