ChineseNER icon indicating copy to clipboard operation
ChineseNER copied to clipboard

请问出错,提示找不到config_file',如何解决为什么?谢谢!

Open Bamboo-TNLP opened this issue 5 years ago • 12 comments

Bamboo-TNLP avatar Apr 04 '19 03:04 Bamboo-TNLP

同问,我也是一样的

chaotianjiao avatar May 28 '19 02:05 chaotianjiao

您好,请问解决了吗

gentlexia avatar Jun 25 '19 06:06 gentlexia

可以试一下在main.py上面的train和clean,吧false修改成true

ghost avatar Jul 01 '19 07:07 ghost

同问,缺少config_file

hh2master avatar Jul 26 '19 07:07 hh2master

可以试一下在main.py上面的train和clean,吧false修改成true

我这边试了下python main.py --train=True --clean=True,可是报错:

File "main.py", line 219, in main
    train()
  File "main.py", line 150, in train
    train_manager = BatchManager(train_data, FLAGS.batch_size)
  File "ChineseNER/data_utils.py", line 285, in __init__
    self.batch_data = self.sort_and_pad(data, batch_size)
  File "ChineseNER/data_utils.py", line 293, in sort_and_pad
    batch_data.append(self.pad_data(sorted_data[i*batch_size : (i+1)*batch_size]))
TypeError: slice indices must be integers or None or have an __index__ method

这个问题有碰到过么,感觉是没有数据产生,但是理论上不应该哇

smartcatdog avatar Sep 21 '19 21:09 smartcatdog

谢谢你的回复,问题已经解决啦,再次感谢!

---原始邮件--- 发件人: "smartcatdog"<[email protected]> 发送时间: 2019年9月22日(星期日) 凌晨5:37 收件人: "zjy-ucas/ChineseNER"<[email protected]>; 抄送: "hh2master"<[email protected]>;"Comment"<[email protected]>; 主题: Re: [zjy-ucas/ChineseNER] 请问出错,提示找不到config_file',如何解决为什么?谢谢! (#62)

可以试一下在main.py上面的train和clean,吧false修改成true

我这边试了下python main.py --train=True --clean=True,可是报错: File "main.py", line 219, in main train() File "main.py", line 150, in train train_manager = BatchManager(train_data, FLAGS.batch_size) File "ChineseNER/data_utils.py", line 285, in init self.batch_data = self.sort_and_pad(data, batch_size) File "ChineseNER/data_utils.py", line 293, in sort_and_pad batch_data.append(self.pad_data(sorted_data[i*batch_size : (i+1)*batch_size])) TypeError: slice indices must be integers or None or have an index method
这个问题有碰到过么,感觉是没有数据产生,但是理论上不应该哇

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

hh2master avatar Sep 22 '19 10:09 hh2master

You should fix the type of batch_size. ,please insert int before batch_size.

fzc1027 avatar Oct 08 '19 03:10 fzc1027

ok,thank u!

------------------ 原始邮件 ------------------ 发件人: "fzc1027"<[email protected]>; 发送时间: 2019年10月8日(星期二) 中午11:15 收件人: "zjy-ucas/ChineseNER"<[email protected]>; 抄送: "冉大成"<[email protected]>; "Comment"<[email protected]>; 主题: Re: [zjy-ucas/ChineseNER] 请问出错,提示找不到config_file',如何解决为什么?谢谢! (#62)

You should fix the type of batch_size. ,please insert int before batch_size.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

hh2master avatar Oct 09 '19 02:10 hh2master

可以试一下在main.py上面的train和clean,吧false修改成true

我这边试了下python main.py --train=True --clean=True,可是报错:

File "main.py", line 219, in main
    train()
  File "main.py", line 150, in train
    train_manager = BatchManager(train_data, FLAGS.batch_size)
  File "ChineseNER/data_utils.py", line 285, in __init__
    self.batch_data = self.sort_and_pad(data, batch_size)
  File "ChineseNER/data_utils.py", line 293, in sort_and_pad
    batch_data.append(self.pad_data(sorted_data[i*batch_size : (i+1)*batch_size]))
TypeError: slice indices must be integers or None or have an __index__ method

这个问题有碰到过么,感觉是没有数据产生,但是理论上不应该哇

batch_data.append(self.pad_data(sorted_data[int(i*batch_size) :int((i+1)*batch_size)]))

BestyWang avatar Oct 22 '19 16:10 BestyWang

@BestyWang 改了之后还是报错 AttributeError: 'bool' object has no attribute 'config_file'

shihuanting avatar Nov 02 '19 13:11 shihuanting

@hh2master 大哥怎么解决的。

shihuanting avatar Nov 02 '19 13:11 shihuanting

You should fix the type of batch_size. ,please insert int before batch_size.

解决了谢谢

niubao123 avatar Feb 26 '22 05:02 niubao123