最近用bert处理进行实体识别,接过代码后测试通过,但是将代码在jupyter中尝试运行,结果报错:

UnrecognizedFlagError: Unknown command line flag 'f' (全部报错信息见文末)

解决办法:给TensorFlow初始化一个 f , 或者说指定 f 标签,在项目报错前(最好在开始)位置添加如下代码即可:

tf.app.flags.DEFINE_string('f', '', 'kernel')

全部报错信息:

---------------------------------------------------------------------------
UnrecognizedFlagError                     Traceback (most recent call last)
<ipython-input-8-608fc881813d> in <module>()
----> 1 bert_config =
modeling.BertConfig.from_json_file(FLAGS.bert_config_file)

~/anaconda3/envs/tensorflow-cpu/lib/python3.6/site-packages/tensorflow/python/platform/flags.py
in __getattr__(self, name)
     82     # a flag.
     83     if not wrapped.is_parsed():
---> 84       wrapped(_sys.argv)
     85     return wrapped.__getattr__(name)
     86 

~/anaconda3/envs/tensorflow-cpu/lib/python3.6/site-packages/absl/flags/_flagvalues.py
in __call__(self, argv, known_only)
    631       suggestions = _helpers.get_flag_suggestions(name, list(self))
    632       raise _exceptions.UnrecognizedFlagError(
--> 633           name, value, suggestions=suggestions)
    634 
    635     self.mark_as_parsed()

UnrecognizedFlagError: Unknown command line flag 'f'
 

技术
©2019-2020 Toolsou All rights reserved,
JVM概述VUE+Canvas 实现桌面弹球消砖块小游戏javascript事件(零基础详解)Pikachu漏洞练习平台明解c/c++程序的内存模型--内存四区python实现vlookup_干货一:怎么在python里面实现vlookupswift 5.0 创建一个获取验证码的按钮,实现倒计时效果首期500亿,成立新部门,腾讯准备做什么?关于蓝桥杯大赛,你应该了解的那些事!解决Selenium ActionChains拖动元素无效