qiskit-tutorials icon indicating copy to clipboard operation
qiskit-tutorials copied to clipboard

qgans_for_loading_random_distributions.ipynb legacy tutorial raises UnboundLocalError

Open nonhermitian opened this issue 4 years ago • 5 comments

Running the tutorial with Qiskit 0.19.6 gives me:


UnboundLocalError: local variable 'd_loss_min' referenced before assignment

Note that I had to drop the number of data samples and epochs by 10x to get it to find this error

nonhermitian avatar Jul 13 '20 20:07 nonhermitian

@Zoufalc could you please look into this problem?

stefan-woerner avatar Jul 15 '20 09:07 stefan-woerner

An error message needs to be added. I will take care of this. What happens is that the number of data samples < batch. This can happen since we need to bin and truncate (remove too large/small values) the input data to map the data points onto basis states.

Zoufalc avatar Jul 15 '20 13:07 Zoufalc

If the number of data samples is the same as what it was set at before, then the runtime is longer than the 3min / cell limit. This is why I tried to reduce it. I guess there is something in the middle that likely works.

nonhermitian avatar Jul 15 '20 13:07 nonhermitian

If you reduce the batch size e.g. to 50, it should work.

Zoufalc avatar Jul 15 '20 14:07 Zoufalc

It is fixed.

Zoufalc avatar Jul 16 '20 13:07 Zoufalc

This tutorial no longer exists in this repo. (And sounds like it was fixed by @Zoufalc!)

Eric-Arellano avatar Aug 18 '23 16:08 Eric-Arellano