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

Evaluation arguments #2

Open
Han8931 opened this issue Feb 26, 2022 · 3 comments
Open

Evaluation arguments #2

Han8931 opened this issue Feb 26, 2022 · 3 comments

Comments

@Han8931
Copy link

Han8931 commented Feb 26, 2022

Hi, I just finished training a Roberta model on IMDb like this

python train.py \
    --train imdb \
    --eval imdb \
    --model-type roberta \
    --model-save-path ./example \
    --num-epochs 4 \
    --num-clean-epochs 1 \
    --num-adv-examples 0.2 \
    --attack-epoch-interval 1 \
    --attack a2t \
    --learning-rate 5e-5 \
    --num-warmup-steps 100 \
    --grad-accumu-steps 1 \
    --checkpoint-interval-epochs 1 \
    --seed 42

and I tried to run the evaluation code

python evaluate.py \
    --dataset imdb \
    --model-type roberta \
    --checkpoint-paths ./example \
    --epoch 4 \
    --save-log \
    --accuracy \
    --robustness \
    --attacks a2t a2t_mlm textfooler bae pwws pso \
    --interpretability 

However, I got the following error

FileNotFoundError: [Errno 2] No such file or directory: './example/test_logs.json'

Did I miss something? In my example folder I can only see train_log.txt file with some checkpoint directories.

@Yogender11
Copy link

Hello,
I'm encountering the same error.
@Han8931, @qiyanjun, @jinyongyoo, @jakegrigsby could you please share your insights on how to resolve it?

@qiyanjun
Copy link
Member

Will take a look

@jinyongyoo
Copy link
Collaborator

@Yogender11 I'm sorry looks like there was a mistake with the file name. The file test_logs.json at

with open(os.path.join(path, "test_logs.json"), "r") as f:
and
with open(os.path.join(path, "test_logs.json"), "r") as f:
both refers to the json log file saved here
os.path.dirname(model_save_path), "accuracy_eval_logs.json"

There must have been some last minute renaming that resulted in this issue. Could you check if accuracy_eval_logs.json file exists and if so, try to change the filenames at L259 and L367 and see if that fixes the problem?

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

4 participants