john-hewitt / structural-probes

Codebase for testing whether hidden states of neural networks encode discrete structures.
Other
381 stars 77 forks source link

Error during parse-distance new experiment #10

Closed siberio76 closed 4 years ago

siberio76 commented 4 years ago

Hi John, I run a parse-depth experiment on my own data and everything worked fine.

When I tried to run a parse-distance experiment using the same hdf5 files previously used, the runtime reports the following error:

Traceback (most recent call last): File "/content/drive/My Drive/structural-probes/structural-probes/run_experiment.py", line 242, in <module> execute_experiment(yaml_args, train_probe=cli_args.train_probe, report_results=cli_args.report_results) File "/content/drive/My Drive/structural-probes/structural-probes/run_experiment.py", line 179, in execute_experiment run_train_probe(args, expt_probe, expt_dataset, expt_model, expt_loss, expt_reporter, expt_regimen) File "/content/drive/My Drive/structural-probes/structural-probes/run_experiment.py", line 128, in run_train_probe dataset.get_train_dataloader(), dataset.get_dev_dataloader()) File "/content/drive/My Drive/structural-probes/structural-probes/regimen.py", line 65, in train_until_convergence batch_loss, count = loss(predictions, label_batch, length_batch) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 532, in __call__ result = self.forward(*input, **kwargs) File "/content/drive/My Drive/structural-probes/structural-probes/loss.py", line 31, in forward predictions_masked = predictions * labels_1s RuntimeError: The size of tensor a (20) must match the size of tensor b (42) at non-singleton dimension 1

I cannot figure out how oe where this disallignement happens... Do you have some clue?

Thanks alot

siberio76 commented 4 years ago

Resolved!

john-hewitt commented 4 years ago

Glad to hear it.