Welcome to TextAttack Discussions! #769
qiyanjun
announced in
Announcements
Replies: 1 comment
-
Cannot have the model.py file after training my lstm model over sst2 datatset without adversarial training Describe the bug To Reproduce
Expected behavior textattack train --model lstm --dataset sst2 --epochs 20 --early-stopping-epochs 3 Screenshots or Traceback textattack attack --model-from-file ./outputs/2024-11-28-11-41-55-920215/best_model/model.py \
--dataset-from-huggingface sst2 \
--attack-recipe deepwordbug \
--log-to-txt results_deepwordbug.txt
textattack: Loading datasets dataset sst2, split train.
textattack: Loading model and tokenizer from file: ./outputs/2024-11-28-11-41-55-920215/best_model/model.py
textattack: Loading module from `./outputs/2024-11-28-11-41-55-920215/best_model/model.py`.
Traceback (most recent call last):
File "/Users/skywarrior/Desktop/texattack/textattack-env-310/lib/python3.10/site-packages/textattack/model_args.py", line 192, in _create_model_from_args
model_module = load_module_from_file(args.model_from_file)
File "/Users/skywarrior/Desktop/texattack/textattack-env-310/lib/python3.10/site-packages/textattack/shared/utils/importing.py", line 63, in load_module_from_file
spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 879, in exec_module
File "<frozen importlib._bootstrap_external>", line 1016, in get_code
File "<frozen importlib._bootstrap_external>", line 1073, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/Users/skywarrior/Desktop/texattack/./outputs/2024-11-28-11-41-55-920215/best_model/model.py'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/skywarrior/Desktop/texattack/textattack-env-310/bin/textattack", line 8, in <module>
sys.exit(main())
File "/Users/skywarrior/Desktop/texattack/textattack-env-310/lib/python3.10/site-packages/textattack/commands/textattack_cli.py", line 49, in main
func.run(args)
File "/Users/skywarrior/Desktop/texattack/textattack-env-310/lib/python3.10/site-packages/textattack/commands/attack_command.py", line 31, in run
model_wrapper = ModelArgs._create_model_from_args(attack_args)
File "/Users/skywarrior/Desktop/texattack/textattack-env-310/lib/python3.10/site-packages/textattack/model_args.py", line 194, in _create_model_from_args
raise ValueError(f"Failed to import file {args.model_from_file}.")
ValueError: Failed to import file ./outputs/2024-11-28-11-41-55-920215/best_model/model.py. System Information (please complete the following information):
Additional context Can someone please help me to reproduce the above figure I would be very grateful to learn and understand why it is or not reproducible |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
👋 Welcome!
We’re using Discussions as a place to connect with other members of our community. We hope that you:
build together 💪.
To get started, comment below with an introduction of yourself and tell us about what you do with this community.
Beta Was this translation helpful? Give feedback.
All reactions