Traceback (most recent call last):
File "./test_error.py", line 40, in <module>
main()
File "./test_error.py", line 35, in main
policy.write(next_action, result)
File "/home/asano/.local/lib/python3.8/site-packages/physbo/search/discrete/policy.py", line 138, in write
np.take(self.actions, local_index, mode="clip") == action
File "<__array_function__ internals>", line 5, in take
File "/usr/lib/python3/dist-packages/numpy/core/fromnumeric.py", line 194, in take
return _wrapfunc(a, 'take', indices, axis=axis, out=out, mode=mode)
File "/usr/lib/python3/dist-packages/numpy/core/fromnumeric.py", line 61, in _wrapfunc
return bound(*args, **kwds)
IndexError: cannot do a non-empty take from an empty axes.
概要
physboをinteractiveモードで実行しているのですが、 最後のactionを評価して結果をwriteする際に以下のエラーが生じるように思います。 再現コードを添付しておりますので、ご確認いただけますと幸いです。
エラー文
再現コード candidates.csv results.csv
import csv import physbo import pandas as pd import numpy as np
def get_data_from_result_list(index): with open('./results.csv') as f: reader = csv.reader(f) l = [row for row in reader]
def main():
dir setting
if name == 'main': main()
if self.actions != []: # skip this for the last action
local_index = np.searchsorted(self.actions, action) local_index = local_index[ np.take(self.actions, local_index, mode="clip") == action ] self.actions = self._delete_actions(local_index)