Anan_King 2021-07-24 20:55 采纳率: 0%
浏览 188
已结题

Pytorch跑bert情感分类报错,TypeError: get_variable_scope() got an unexpected keyword argument 'name'

Traceback (most recent call last):
File "F:/WorkShop/BERT_Chinese_Classification/run_classifier.py", line 1036, in
tf.app.run()
File "E:\Anaconda\Install\envs\pytorch\lib\site-packages\tensorflow\python\platform\app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "E:\Anaconda\Install\envs\pytorch\lib\site-packages\absl\app.py", line 312, in run
_run_main(main, args)
File "E:\Anaconda\Install\envs\pytorch\lib\site-packages\absl\app.py", line 258, in _run_main
sys.exit(main(argv))
File "F:/WorkShop/BERT_Chinese_Classification/run_classifier.py", line 935, in main
estimator.train(input_fn=train_input_fn, max_steps=num_train_steps)
File "E:\Anaconda\Install\envs\pytorch\lib\site-packages\tensorflow_estimator\python\estimator\tpu\tpu_estimator.py", line 3110, in train
rendezvous.raise_errors()
File "E:\Anaconda\Install\envs\pytorch\lib\site-packages\tensorflow_estimator\python\estimator\tpu\error_handling.py", line 150, in raise_errors
six.reraise(typ, value, traceback)
File "E:\Anaconda\Install\envs\pytorch\lib\site-packages\six.py", line 703, in reraise
raise value
File "E:\Anaconda\Install\envs\pytorch\lib\site-packages\tensorflow_estimator\python\estimator\tpu\tpu_estimator.py", line 3100, in train
return super(TPUEstimator, self).train(
File "E:\Anaconda\Install\envs\pytorch\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 349, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "E:\Anaconda\Install\envs\pytorch\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1175, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "E:\Anaconda\Install\envs\pytorch\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1203, in _train_model_default
estimator_spec = self._call_model_fn(features, labels, ModeKeys.TRAIN,
File "E:\Anaconda\Install\envs\pytorch\lib\site-packages\tensorflow_estimator\python\estimator\tpu\tpu_estimator.py", line 2941, in _call_model_fn
return super(TPUEstimator, self)._call_model_fn(features, labels, mode,
File "E:\Anaconda\Install\envs\pytorch\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1163, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "E:\Anaconda\Install\envs\pytorch\lib\site-packages\tensorflow_estimator\python\estimator\tpu\tpu_estimator.py", line 3199, in _model_fn
estimator_spec = model_fn_wrapper.call_without_tpu(
File "E:\Anaconda\Install\envs\pytorch\lib\site-packages\tensorflow_estimator\python\estimator\tpu\tpu_estimator.py", line 1729, in call_without_tpu
return self._call_model_fn(features, labels, is_export_mode=is_export_mode)
File "E:\Anaconda\Install\envs\pytorch\lib\site-packages\tensorflow_estimator\python\estimator\tpu\tpu_estimator.py", line 2072, in _call_model_fn
estimator_spec = self._model_fn(features=features, **kwargs)
File "F:/WorkShop/BERT_Chinese_Classification/run_classifier.py", line 697, in model_fn
(total_loss, per_example_loss, logits, probabilities) = create_model(
File "F:/WorkShop/BERT_Chinese_Classification/run_classifier.py", line 631, in create_model
model = modeling.BertModel(
File "F:\WorkShop\BERT_Chinese_Classification\modeling.py", line 175, in init
(self.embedding_output, self.embedding_table) = embedding_lookup(
File "F:\WorkShop\BERT_Chinese_Classification\modeling.py", line 411, in embedding_lookup
embedding_table = tf.compat.v1.get_variable_scope(
TypeError: get_variable_scope() got an unexpected keyword argument 'name'

  • 写回答

1条回答 默认 最新

  • 有问必答小助手 2021-07-26 19:06
    关注

    你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,超出我们目前的服务范围,暂时无法为您解答。

    问答VIP目前服务范围为 :Python、Java、MySQL、Redis、MongoDB、HBase、Zookeeper、Kafka、Linux领域专业问题解答,为您提供解决问题的思路和指导。 不提供源码代写、项目文档代写、论文代写、作业代写、安装包资源发送或安装指导等服务。

    本次提问扣除的有问必答次数,已经为您补发到账户,我们后续会持续优化,扩大我们的服务范围,为您带来更好地服务。

    评论

报告相同问题?

问题事件

  • 系统已结题 8月1日
  • 创建了问题 7月24日

悬赏问题

  • ¥15 组策略中的计算机配置策略无法下发
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)
  • ¥50 mac mini外接显示器 画质字体模糊
  • ¥15 TLS1.2协议通信解密
  • ¥40 图书信息管理系统程序编写
  • ¥20 Qcustomplot缩小曲线形状问题