Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'module' object is not callable #1

Closed
DavidNemeskey opened this issue Feb 4, 2016 · 1 comment
Closed

TypeError: 'module' object is not callable #1

DavidNemeskey opened this issue Feb 4, 2016 · 1 comment

Comments

@DavidNemeskey
Copy link

I tried to run the code (python main.py --dataset ptb), and it failed with this exception:

...
Creating vocab...
After first pass of data, max word length is: 21
Token count: train 929589, val 73760, test 82430
Loading vocab...
Word vocab size: 10001, Char vocab size: 51
Reshaping tensors...
data load done. Number of batches in train: 265, val: 21, test: 23
Word vocab size: 10001, Char vocab size: 51, Max word length (incl. padding): 21
Traceback (most recent call last):
  File "main.py", line 66, in <module>
    tf.app.run()
  File "/home/ndavid/venvs/embedding/local/lib/python2.7/site-packages/tensorflow/python/platform/default/_app.py", line 11, in run
    sys.exit(main(sys.argv))
  File "main.py", line 57, in main
    data_dir=FLAGS.data_dir)
  File "/mnt/store/ndavid/LM/Others/lstm-char-cnn-tensorflow/models/LSTMTDNN.py", line 86, in __init__
    self.prepare_model()
  File "/mnt/store/ndavid/LM/Others/lstm-char-cnn-tensorflow/models/LSTMTDNN.py", line 144, in prepare_model
    cnn_output = highway(cnn_output, cnn_output.get_shape()[1], self.highway_layers, 0)
  File "/mnt/store/ndavid/LM/Others/lstm-char-cnn-tensorflow/models/ops.py", line 28, in highway
    output = f(rnn_cell.linear(output, size, 0, scope='output_lin_%d' % idx))
TypeError: 'module' object is not callable

I am using tensorflow version 0.5 (I think that's the latest one, but I am not sure).

@carpedm20
Copy link
Owner

The most recent Tensorflow is 0.6 and I think there is a problem in rnn_cell.linear. In Tensorflow 0.5, linear was in rnn.linear not rnn_cell.linear. You'd better update it or chagne the path.

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

No branches or pull requests

2 participants