Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run_hyper_search.py is not working #23

Open
Marzie00Abd opened this issue May 23, 2022 · 3 comments
Open

run_hyper_search.py is not working #23

Marzie00Abd opened this issue May 23, 2022 · 3 comments

Comments

@Marzie00Abd
Copy link

Failure # 1 (occurred at 2022-05-23_16-22-42)
Traceback (most recent call last):
File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/tune/ray_trial_executor.py", line 901, in get_next_executor_event
future_result = ray.get(ready_future)
File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/_private/client_mode_hook.py", line 105, in wrapper
return func(*args, **kwargs)
File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/worker.py", line 1809, in get
raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(TuneError): �[36mray::ImplicitFunc.train()�[39m (pid=70586, ip=192.168.21.70, repr=func)
File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/tune/trainable.py", line 349, in train
result = self.step()
File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/tune/function_runner.py", line 403, in step
self._report_thread_runner_error(block=True)
File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/tune/function_runner.py", line 568, in _report_thread_runner_error
("Trial raised an exception. Traceback:\n{}".format(err_tb_str))
ray.tune.error.TuneError: Trial raised an exception. Traceback:
�[36mray::ImplicitFunc.train()�[39m (pid=70586, ip=192.168.21.70, repr=func)
File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/tune/function_runner.py", line 272, in run
self._entrypoint()
File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/tune/function_runner.py", line 351, in entrypoint
self._status_reporter.get_checkpoint(),
File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/tune/function_runner.py", line 640, in _trainable_func
output = fn()
File "/home/marzieh/PycharmProjects/mwptoolkit/MWPToolkit/mwptoolkit/hyper_search.py", line 34, in train_process
dataset = create_dataset(configs)
File "/home/marzieh/PycharmProjects/mwptoolkit/MWPToolkit/mwptoolkit/data/utils.py", line 47, in create_dataset
return SingleEquationDataset(config)
File "/home/marzieh/PycharmProjects/mwptoolkit/MWPToolkit/mwptoolkit/data/dataset/single_equation_dataset.py", line 89, in init
super().init(config)
File "/home/marzieh/PycharmProjects/mwptoolkit/MWPToolkit/mwptoolkit/data/dataset/abstract_dataset.py", line 116, in init
self._load_k_fold_dataset()
File "/home/marzieh/PycharmProjects/mwptoolkit/MWPToolkit/mwptoolkit/data/dataset/abstract_dataset.py", line 194, in _load_k_fold_dataset
datas = self._load_all_data()
File "/home/marzieh/PycharmProjects/mwptoolkit/MWPToolkit/mwptoolkit/data/dataset/abstract_dataset.py", line 128, in _load_all_data
trainset = read_json_data(os.path.join(os.getcwd(), trainset_file))
File "/home/marzieh/PycharmProjects/mwptoolkit/MWPToolkit/mwptoolkit/utils/utils.py", line 33, in read_json_data
f = open(filename, 'r', encoding="utf-8")
FileNotFoundError: [Errno 2] No such file or directory: '/home/marzieh/ray_results/train_process_2022-05-23_16-22-25/train_process_d056d_00000_0_embedding_size=128,epoch_nums=80,hidden_size=2,test_batch_size=16,train_batch_size=16_2022-05-23_16-22-25/dataset/pmwp/trainset.json'

why is it reading trainset.json from this path -- '/home/marzieh/ray_results/train_process_2022-05-23_16-22-25/train_process_d056d_00000_0_embedding_size=128,epoch_nums=80,hidden_size=2,test_batch_size=16,train_batch_size=16_2022-05-23_16-22-25/dataset/pmwp/trainset.json' -- ??

@Marzie00Abd
Copy link
Author

which version of ray are you using?
errors I get:

Failure # 1 (occurred at 2022-05-28_17-26-33)
Traceback (most recent call last):
File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/tune/ray_trial_executor.py", line 901, in get_next_executor_event
future_result = ray.get(ready_future)
File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/_private/client_mode_hook.py", line 105, in wrapper
return func(*args, **kwargs)
File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/worker.py", line 1809, in get
raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(TuneError): �[36mray::ImplicitFunc.train()�[39m (pid=21738, ip=192.168.21.105, repr=func)
File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/tune/trainable.py", line 349, in train
result = self.step()
File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/tune/function_runner.py", line 412, in step
"Wrapped function ran until completion without reporting "
ray.tune.error.TuneError: Wrapped function ran until completion without reporting results or raising an exception.

@LYH-YF
Copy link
Owner

LYH-YF commented Jun 7, 2022

Failure # 1 (occurred at 2022-05-23_16-22-42) Traceback (most recent call last): File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/tune/ray_trial_executor.py", line 901, in get_next_executor_event future_result = ray.get(ready_future) File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/_private/client_mode_hook.py", line 105, in wrapper return func(*args, **kwargs) File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/worker.py", line 1809, in get raise value.as_instanceof_cause() ray.exceptions.RayTaskError(TuneError): �[36mray::ImplicitFunc.train()�[39m (pid=70586, ip=192.168.21.70, repr=func) File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/tune/trainable.py", line 349, in train result = self.step() File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/tune/function_runner.py", line 403, in step self._report_thread_runner_error(block=True) File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/tune/function_runner.py", line 568, in _report_thread_runner_error ("Trial raised an exception. Traceback:\n{}".format(err_tb_str)) ray.tune.error.TuneError: Trial raised an exception. Traceback: �[36mray::ImplicitFunc.train()�[39m (pid=70586, ip=192.168.21.70, repr=func) File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/tune/function_runner.py", line 272, in run self._entrypoint() File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/tune/function_runner.py", line 351, in entrypoint self._status_reporter.get_checkpoint(), File "/home/marzieh/anaconda3/envs/mwptoolkit/lib/python3.7/site-packages/ray/tune/function_runner.py", line 640, in _trainable_func output = fn() File "/home/marzieh/PycharmProjects/mwptoolkit/MWPToolkit/mwptoolkit/hyper_search.py", line 34, in train_process dataset = create_dataset(configs) File "/home/marzieh/PycharmProjects/mwptoolkit/MWPToolkit/mwptoolkit/data/utils.py", line 47, in create_dataset return SingleEquationDataset(config) File "/home/marzieh/PycharmProjects/mwptoolkit/MWPToolkit/mwptoolkit/data/dataset/single_equation_dataset.py", line 89, in init super().init(config) File "/home/marzieh/PycharmProjects/mwptoolkit/MWPToolkit/mwptoolkit/data/dataset/abstract_dataset.py", line 116, in init self._load_k_fold_dataset() File "/home/marzieh/PycharmProjects/mwptoolkit/MWPToolkit/mwptoolkit/data/dataset/abstract_dataset.py", line 194, in _load_k_fold_dataset datas = self._load_all_data() File "/home/marzieh/PycharmProjects/mwptoolkit/MWPToolkit/mwptoolkit/data/dataset/abstract_dataset.py", line 128, in _load_all_data trainset = read_json_data(os.path.join(os.getcwd(), trainset_file)) File "/home/marzieh/PycharmProjects/mwptoolkit/MWPToolkit/mwptoolkit/utils/utils.py", line 33, in read_json_data f = open(filename, 'r', encoding="utf-8") FileNotFoundError: [Errno 2] No such file or directory: '/home/marzieh/ray_results/train_process_2022-05-23_16-22-25/train_process_d056d_00000_0_embedding_size=128,epoch_nums=80,hidden_size=2,test_batch_size=16,train_batch_size=16_2022-05-23_16-22-25/dataset/pmwp/trainset.json'

why is it reading trainset.json from this path -- '/home/marzieh/ray_results/train_process_2022-05-23_16-22-25/train_process_d056d_00000_0_embedding_size=128,epoch_nums=80,hidden_size=2,test_batch_size=16,train_batch_size=16_2022-05-23_16-22-25/dataset/pmwp/trainset.json' -- ??

you may note a parameter 'dataset_dir' in V0.0.6 or 'dataset_path' in V0.0.5 which is the dataset folder.

This error may occur in version 0.0.6 . The default value of this parameter is a relative path. And when reading the dataset file, we use absolute path. The root directory of mwptoolkit is different from ray's. When running run_hyper_search.py the root directory will change to ray's. This causes the wrong absolute path.

You can directly set a absolute path to the dataset folder. For your dataset
The default value of 'dataset_dir' is /dataset/pmwp.
You can set it with command line like --dataset_dir=[root]/dataset/pmwp

I will look for a better way to solve this problem.

@LYH-YF
Copy link
Owner

LYH-YF commented Jun 7, 2022

I recommend version 1.3.0 of ray

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants