Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

TypeError: sparse_to_dense() missing 2 required positional arguments #16

Closed
bigcat2333 opened this issue Jun 5, 2019 · 1 comment
Closed

Comments

@bigcat2333
Copy link

在运行bidaf_squadv2.py时遇到了如下报错:
File "G:\SMRCToolkit-master\sogou_mrc\data\batch_generator.py", line 121, in extract_char
out = tf.sparse.to_dense(out, default_value=default_value)
AttributeError: module 'tensorflow' has no attribute 'sparse'

我将文件中的tf.sparse.to_dense改为tf.sparse_to_dense,但是依旧报错
File "G:\SMRCToolkit-master\sogou_mrc\data\batch_generator.py", line 145, in transform_new_instance
context_char = extract_char(context_tokens)
File "G:\SMRCToolkit-master\sogou_mrc\data\batch_generator.py", line 121, in extract_char
out = tf.sparse_to_dense(out, default_value=default_value)
TypeError: sparse_to_dense() missing 2 required positional arguments: 'output_shape' and 'sparse_values'
请问这个问题该如何解决呢?

@yxk9810
Copy link
Contributor

yxk9810 commented Jun 5, 2019

This repo was tested on Python 3 and Tensorflow 1.12. Please check version of Tensorflow.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants