TuneError: Error running trial: 'bool' object is not callable

While doing hyperparameter optimization using Ray Tune in pytorch, getting the below error:


Traceback (most recent call last):
  File "/home/vsl3/anaconda2/lib/python2.7/site-packages/ray/worker.py", line 891, in _process_task
    *arguments)
  File "/home/vsl3/anaconda2/lib/python2.7/site-packages/ray/actor.py", line 261, in actor_method_executor
    method_returns = method(actor, *args)
  File "/home/vsl3/anaconda2/lib/python2.7/site-packages/ray/tune/trainable.py", line 117, in train
    result = self._train()
  File "/home/vsl3/anaconda2/lib/python2.7/site-packages/ray/tune/function_runner.py", line 114, in _train
    result = self._status_reporter._get_and_clear_status()
  File "/home/vsl3/anaconda2/lib/python2.7/site-packages/ray/tune/function_runner.py", line 39, in _get_and_clear_status
    raise TuneError("Error running trial: " + str(self._error))
TuneError: Error running trial: 'bool' object is not callable


Could you check the type of self._train and self._status_reporter._get_and_clear_status?
Apparently you are trying to call a bool value as the error suggests.

Actually, below is my code which is calling boolean:


mask = np.zeros(len(orig_cmc), dtype=np.bool)

If I am not using Ray Tune, the code works. But how to call boolean object using Ray Tune?

I"m not familiar with Ray Tune, but the error seems to come from a call to a bool value:

mask = True
mask()
> TypeError: 'bool' object is not callable

Thanks, you correctly pointed out the error. :blush: