Closed RoshniRM closed 2 years ago
Hi @RoshniRM, thanks for reporting on the issue! We have a fix for this issue, it will be included in the next release. Meanwhile, please change ~\AppData\Local\Continuum\anaconda3\envs\qnlp\lib\site-packages\lambeq\training\tket_model.py:71
to the following:
return np.random.randint(low, high, dtype=np.int64)
thanks. I made the change and it works!
Hi ,
Ran into an issue when running the quantum trainer : "ValueError: low is out of bounds for int32"
stack trace:
File ~\AppData\Local\Continuum\anaconda3\envs\qnlp\lib\site-packages\lambeq\training\tket_model.py:103, in TketModel.get_diagram_output(self, diagrams) 93 raise ValueError('Weights and/or symbols not initialised. ' 94 'Instantiate through ' 95 '
TketModel.from_diagrams()
first, ' 96 'then callinitialise_weights()
, or load ' 97 'from pre-trained checkpoint.') 99 lambdified_diagrams = [self._make_lambda(d) for d in diagrams] 100 tensors = Circuit.eval( 101 [diag_f(self.weights) for diag_f in lambdified_diagrams], 102 **self.backend_config, --> 103 seed=self._randint() 104 ) 105 self.backend_config['backend'].empty_cache() 106 # discopy evals a single diagram into a single result 107 # and not a list of resultsFile ~\AppData\Local\Continuum\anaconda3\envs\qnlp\lib\site-packages\lambeq\training\tket_model.py:71, in TketModel._randint(self, low, high) 70 def _randint(self, low=-1 << 63, high=(1 << 63)-1): ---> 71 return np.random.randint(low, high)