Comments (18)
Hi, you need to pass the "train_by_pair" argument
from bgca.
你好,所有的参数设置可以在setup.py里面查看详细的解释。
缺失模块的原因是因为调用main函数的时候,未从命令行传入"--train_by_pair", 具体调用方式可以参考以下脚本最后一行:
https://github.com/DAMO-NLP-SG/BGCA/blob/master/script/run_ate.sh#L34
from bgca.
Traceback (most recent call last):
File "C:\Users\孤星\Desktop\BGCA-master\code\main.py", line 329, in
runed_dirs = run_multiple_seeds(args, seed_list)
File "C:\Users\孤星\Desktop\BGCA-master\code\main.py", line 319, in run_multiple_seeds
main(args)
File "C:\Users\孤星\Desktop\BGCA-master\code\main.py", line 137, in main
tokenizer = AutoTokenizer.from_pretrained(args.model_name_or_path, use_fast=False)
File "C:\Program Files\Python39\lib\site-packages\transformers\models\auto\tokenization_auto.py", line 471, in from_pretrained
tokenizer_config = get_tokenizer_config(pretrained_model_name_or_path, **kwargs)
File "C:\Program Files\Python39\lib\site-packages\transformers\models\auto\tokenization_auto.py", line 332, in get_tokenizer_config
resolved_config_file = get_file_from_repo(
File "C:\Program Files\Python39\lib\site-packages\transformers\utils\hub.py", line 678, in get_file_from_repo
resolved_file = cached_path(
File "C:\Program Files\Python39\lib\site-packages\transformers\utils\hub.py", line 282, in cached_path
output_path = get_from_cache(
File "C:\Program Files\Python39\lib\site-packages\transformers\utils\hub.py", line 545, in get_from_cache
raise ValueError(
ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on.
您好,我想问问您报的这个错误怎么解决呢?(非常感谢您的回答)
from bgca.
你好,这个应该是huggingface的模型下载问题,可以参考https://huggingface.co/t5-base 进行下载。
如果是国内网络引起的话,可以考虑通过镜像下载或者提前下载至本地。
from bgca.
Traceback (most recent call last):
File "C:\Users\孤星\Desktop\dataset\BGCA-master\code\main.py", line 329, in
runed_dirs = run_multiple_seeds(args, seed_list)
File "C:\Users\孤星\Desktop\dataset\BGCA-master\code\main.py", line 319, in run_multiple_seeds
main(args)
File "C:\Users\孤星\Desktop\dataset\BGCA-master\code\main.py", line 137, in main
tokenizer = AutoTokenizer.from_pretrained(args.model_name_or_path)
File "C:\Users\孤星\AppData\Roaming\Python\Python39\site-packages\transformers\models\auto\tokenization_auto.py", line 528, in from_pretrained
return tokenizer_class.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
File "C:\Users\孤星\AppData\Roaming\Python\Python39\site-packages\transformers\tokenization_utils_base.py", line 1780, in from_pretrained
return cls._from_pretrained(
File "C:\Users\孤星\AppData\Roaming\Python\Python39\site-packages\transformers\tokenization_utils_base.py", line 1806, in _from_pretrained
slow_tokenizer = (cls.slow_tokenizer_class).from_pretrained(
File "C:\Users\孤星\AppData\Roaming\Python\Python39\site-packages\transformers\tokenization_utils_base.py", line 1915, in from_pretrained
tokenizer = cls(*init_inputs, **init_kwargs)
File "C:\Users\孤星\AppData\Roaming\Python\Python39\site-packages\transformers\models\t5\tokenization_t5.py", line 152, in init
self.sp_model.Load(vocab_file)
File "C:\Program Files\Python39\lib\site-packages\sentencepiece_init.py", line 367, in Load
return self.LoadFromFile(model_file)
File "C:\Program Files\Python39\lib\site-packages\sentencepiece_init.py", line 171, in LoadFromFile
return _sentencepiece.SentencePieceProcessor_LoadFromFile(self, arg)
TypeError: not a string
from bgca.
请确认相关package版本一致: https://github.com/DAMO-NLP-SG/BGCA/blob/master/requirements.txt
并检查hugging face下载文件是否完整: https://huggingface.co/t5-base/tree/main
可以尝试在python shell / notebook中检查模型是否能正常加载,再尝试运行当前repo代码
from bgca.
您好,代码跑到中途的时候还是出现了这个问题:
Traceback (most recent call last):
File "C:\BGCA-master\BGCA-master\code\main.py", line 329, in
collate_seed_results(args, runed_dirs)
File "C:\BGCA-master\BGCA-master\code\main.py", line 291, in collate_seed_results
avg_n_seeds_by_pair(args.output_dir, runed_dirs, decode_txt, args.n_runs)
File "C:\BGCA-master\BGCA-master\code\eval_utils.py", line 391, in avg_n_seeds_by_pair
score_dict_i = json.load(open(f"{dir_}/score/test_{decode_txt}_score.json","r"))
FileNotFoundError: [Errno 2] No such file or directory: '../outputs/uabsa/cross_domain\0609_2051-experinments/seed-3/laptop-rest/score/test_greedy_score.json'
from bgca.
你好,问题应该出自windows和Linux系统之间的路径差异, '../outputs/uabsa/cross_domain\0609_2051-experinments/seed-3/laptop-rest/score/test_greedy_score.json' 路径中“cross_domain\0609_2051"处被setup.py 105行处代码自动添加为了反斜,将该处代码改成以正斜字符串联路径应该可以解决
from bgca.
您好,源代码中只有正斜字符,我修改了很多次,还是跑不通,这是一部分源码
Set up output directory
output_dir = f"../outputs/{args.task}/{args.dataset}"
os.makedirs(output_dir, exist_ok=True)
# Create a timestamped directory
timestamp = datetime.now().strftime("%m%d_%H%M")
output_dir = os.path.join(output_dir, f"{timestamp}-{args.name}").replace("/", "\\")
os.makedirs(output_dir, exist_ok=True)
args.output_dir = output_dir
return args
以下是报错部分:(已经跑通了一段时间,但是跑到这里的时候就报错了)
Traceback (most recent call last):
File "C:\BGCA-master\BGCA-master\code\main.py", line 329, in
collate_seed_results(args, runed_dirs)
File "C:\BGCA-master\BGCA-master\code\main.py", line 291, in collate_seed_results
avg_n_seeds_by_pair(args.output_dir, runed_dirs, decode_txt, args.n_runs)
File "C:\BGCA-master\BGCA-master\code\eval_utils.py", line 391, in avg_n_seeds_by_pair
score_dict_i = json.load(open(f"{dir_}/score/test_{decode_txt}_score.json","r")).replace("/", "\")
FileNotFoundError: [Errno 2] No such file or directory: '..\outputs\uabsa\cross_domain\0611_1422-experinments/seed-3/laptop-rest/score/test_greedy_score.json'
from bgca.
通过你提供的结果来看的话,output_dir = os.path.join(output_dir, f"{timestamp}-{args.name}").replace("/", "\") 会导致正反斜混用(如截图报错所示,路径前半段为双反斜,后半段为正斜),因为这处代码只涉及到输出文件夹,后续的具体存档文件路径处代码没有修改成双反斜。
简单的做法是可以尝试全部统一成正斜,具体是只将setup.py 105行处改为 output_dir = f"{output_dir}/{timestamp}-{args.name}"。
from bgca.
Traceback (most recent call last):
File "C:\BGCA-master\BGCA-master\code\main.py", line 329, in
collate_seed_results(args, runed_dirs)
File "C:\BGCA-master\BGCA-master\code\main.py", line 291, in collate_seed_results
avg_n_seeds_by_pair(args.output_dir, runed_dirs, decode_txt, args.n_runs)
File "C:\BGCA-master\BGCA-master\code\eval_utils.py", line 391, in avg_n_seeds_by_pair
score_dict_i = json.load(open(f"{dir_}/score/test_{decode_txt}_score.json","r"))
FileNotFoundError: [Errno 2] No such file or directory: '../outputs/uabsa/cross_domain/0612_1721-experinments/seed-3/laptop-rest/score/test_greedy_score.json'
from bgca.
你好,请问在文件系统中能看到该文件吗?
from bgca.
from bgca.
是的,里面有test_greed_score.json文件吗?
from bgca.
没有的,到这一步就点不开这个文件了
from bgca.
你好,我注意到你的tag tokens 也是空的,能否上传你的运行脚本和log文件方便我查看
from bgca.
好的,可以的,等我有时间我在给您上传
from bgca.
可以发送至我邮箱:[email protected]
from bgca.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bgca.