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

Issue in running the evaluation for ERE as per README.md #16

Open
yardstick17 opened this issue Feb 26, 2024 · 1 comment
Open

Issue in running the evaluation for ERE as per README.md #16

yardstick17 opened this issue Feb 26, 2024 · 1 comment

Comments

@yardstick17
Copy link

On running the evaluations as mentioned here: https://github.com/lyutyuh/ASP/tree/master?tab=readme-ov-file#pre-trained-models

python evaluate_ere.py flant5_base_conll04 tliu/asp-re-flan-t5-base 0

It errors out as: FileNotFoundError for /data/conll04_ere/train_dev.t5-small.jsonlines

Following is the stacktrace:

(asp) ➜  ASP git:(master) ✗ python evaluate_ere.py flant5_base_conll04 tliu/asp-re-flan-t5-base 0
02/26/2024 10:28:38 - INFO - util.func - Running experiment: flant5_base_conll04
02/26/2024 10:28:38 - INFO - util.func - task = "ere"
dataset = "conll04"
data_dir = "/home/kushwaha/Projects/ASP/data/conll04_ere/"
model_dir = "/home/kushwaha/Projects/ASP/data/conll04_ere/"
log_root = "/home/kushwaha/Projects/ASP/data/conll04_ere/"
max_segment_len = 256
use_amp = true
optimizer = "adamw"
plm_learning_rate = 5e-05
task_learning_rate = 0.0001
plm_scheduler = "linear_with_warmup"
task_scheduler = "linear_with_warmup"
warmup_ratio = 0.05
adam_eps = 1e-08
adam_weight_decay = 0.1
init_std = 0.02
max_grad_norm = 1
batch_size = 8
gradient_accumulation_steps = 1
num_epochs = 200
activation = "relu"
dropout_rate = 0.3
feature_emb_size = 20
hidden_size = 1500
num_typing_classes = 4
num_linking_classes = 5
beam_size = 1
eval_frequency = 500
report_frequency = 20
plm_tokenizer_name = "t5-small"
plm_pretrained_name_or_path = "google/flan-t5-base"
log_dir = "/home/kushwaha/Projects/ASP/data/conll04_ere/flant5_base_conll04"
tb_dir = "/home/kushwaha/Projects/ASP/data/conll04_ere/tensorboard"
02/26/2024 10:28:38 - INFO - /home/kushwaha/Projects/ASP/util/runner.py - Log file path: /home/kushwaha/Projects/ASP/data/conll04_ere/flant5_base_conll04/log_Feb26_10-28-38.txt
02/26/2024 10:28:39 - INFO - util.tensorize_ere - Tensorizing examples from /home/kushwaha/Projects/ASP/data/conll04_ere/train_dev.t5-small.jsonlines; results will be cached in /home/kushwaha/Projects/ASP/data/conll04_ere/cached.tensors.t5-small.bin
Traceback (most recent call last):
  File "evaluate_ere.py", line 24, in <module>
    evaluate(config_name, gpu_id, saved_suffix)
  File "evaluate_ere.py", line 7, in evaluate
    runner = ERERunner(
  File "/home/kushwaha/Projects/ASP/util/runner.py", line 76, in __init__
    self.data = EREDataProcessor(self.config)
  File "/home/kushwaha/Projects/ASP/util/tensorize_ere.py", line 61, in __init__
    with open(path, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/kushwaha/Projects/ASP/data/conll04_ere/train_dev.t5-small.jsonlines'

Questions:

  • Where to find or generate train_dev.t5-small.jsonlines file?
  • There is a link for pre-trained weights: where to configure it to be used?
@yardstick17
Copy link
Author

With python ./data/t5minimize_ere.py ./data/conll04_ere it generated the file: train_dev.t5-small.jsonline

Now I am getting this new error:

(asp) ➜  ASP git:(master) ✗ python evaluate_ere.py flant5_base_conll04 tliu/asp-re-flan-t5-base 0
02/26/2024 10:56:10 - INFO - util.func - Running experiment: flant5_base_conll04
02/26/2024 10:56:11 - INFO - util.func - task = "ere"
dataset = "conll04"
data_dir = "/home/kushwaha/Projects/ASP/data/conll04_ere/"
model_dir = "/home/kushwaha/Projects/ASP/data/conll04_ere/"
log_root = "/home/kushwaha/Projects/ASP/data/conll04_ere/"
max_segment_len = 256
use_amp = true
optimizer = "adamw"
plm_learning_rate = 5e-05
task_learning_rate = 0.0001
plm_scheduler = "linear_with_warmup"
task_scheduler = "linear_with_warmup"
warmup_ratio = 0.05
adam_eps = 1e-08
adam_weight_decay = 0.1
init_std = 0.02
max_grad_norm = 1
batch_size = 8
gradient_accumulation_steps = 1
num_epochs = 200
activation = "relu"
dropout_rate = 0.3
feature_emb_size = 20
hidden_size = 1500
num_typing_classes = 4
num_linking_classes = 5
beam_size = 1
eval_frequency = 500
report_frequency = 20
plm_tokenizer_name = "t5-small"
plm_pretrained_name_or_path = "google/flan-t5-base"
log_dir = "/home/kushwaha/Projects/ASP/data/conll04_ere/flant5_base_conll04"
tb_dir = "/home/kushwaha/Projects/ASP/data/conll04_ere/tensorboard"
02/26/2024 10:56:11 - INFO - /home/kushwaha/Projects/ASP/util/runner.py - Log file path: /home/kushwaha/Projects/ASP/data/conll04_ere/flant5_base_conll04/log_Feb26_10-56-10.txt
02/26/2024 10:56:11 - INFO - util.tensorize_ere - Tensorizing examples from /home/kushwaha/Projects/ASP/data/conll04_ere/train_dev.t5-small.jsonlines; results will be cached in /home/kushwaha/Projects/ASP/data/conll04_ere/cached.tensors.t5-small.bin
Traceback (most recent call last):
  File "evaluate_ere.py", line 24, in <module>
    evaluate(config_name, gpu_id, saved_suffix)
  File "evaluate_ere.py", line 7, in evaluate
    runner = ERERunner(
  File "/home/kushwaha/Projects/ASP/util/runner.py", line 76, in __init__
    self.data = EREDataProcessor(self.config)
  File "/home/kushwaha/Projects/ASP/util/tensorize_ere.py", line 63, in __init__
    tensor_samples = [tensorizer.tensorize_example(sample, is_training) for sample in samples]
  File "/home/kushwaha/Projects/ASP/util/tensorize_ere.py", line 63, in <listcomp>
    tensor_samples = [tensorizer.tensorize_example(sample, is_training) for sample in samples]
  File "/home/kushwaha/Projects/ASP/util/tensorize_ere.py", line 180, in tensorize_example
    action_labels = self.get_action_labels(target_ids)
  File "/home/kushwaha/Projects/ASP/util/tensorize_ere.py", line 125, in get_action_labels
    action_labels = torch.where(
TypeError: where(): argument 'input' (position 2) must be Tensor, not int

It is because I am running on a CPU machine?

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

1 participant