zjy-ucas / ChineseNER

A neural network model for Chinese named entity recognition
1.78k stars 568 forks source link

我修改了clean和train的False为True 然后运行报出name 'tf' is not defined的错误是什么情况 #90

Closed lengsihan closed 1 year ago

lengsihan commented 1 year ago

Traceback (most recent call last): File "D:\ChineseNER-master\main.py", line 226, in if name == "main": File "D:\anaconda\envs\py36\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "D:\ChineseNER-master\main.py", line 220, in main clean(FLAGS) File "D:\ChineseNER-master\main.py", line 172, in train with tf.Session(config=tf_config) as sess: File "D:\ChineseNER-master\utils.py", line 172, in create_model model = Model_class(config) File "D:\ChineseNER-master\model.py", line 25, in init self.global_step = tf.Variable(0, trainable=False) NameError: name 'tf' is not defined

进程已结束,退出代码1

lengsihan commented 1 year ago

已解决