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

global_variables_initializer error - tensor flow 12.1 #7

Closed
GenTxt opened this issue Jan 15, 2017 · 4 comments
Closed

global_variables_initializer error - tensor flow 12.1 #7

GenTxt opened this issue Jan 15, 2017 · 4 comments

Comments

@GenTxt
Copy link

GenTxt commented Jan 15, 2017

Hi.

I would like to start generating models from my own data but I'm unable to get the code working. Running ubuntu 16 & 14 64 bit and current tensorflow 12.1 on nvidia gpu.
I've checked several forums and there are similar issues with tensorflow 12.

If this cannot be fixed is it possible to post your previous code that works on earlier versions of tensorflow?

Thanks

Traceback (most recent call last):
File "pretrain_experiment.py", line 123, in
main()
File "pretrain_experiment.py", line 93, in main
sess.run(tf.global_variables_initializer)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 766, in run
run_metadata_ptr)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 951, in _run
fetch_handler = _FetchHandler(self._graph, fetches, feed_dict_string)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 407, in init
self._fetch_mapper = _FetchMapper.for_fetch(fetches)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 238, in for_fetch
return _ElementFetchMapper(fetches, contraction_fn)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 271, in init
% (fetch, type(fetch), str(e)))
TypeError: Fetch argument <function global_variables_initializer at 0x7fb92909bb18> has invalid type <type 'function'>, must be a string or Tensor. (Can not convert a function into a Tensor or Operation.)

Similar error when running sequence_gan.py

@eecrazy
Copy link

eecrazy commented Jan 16, 2017

sess.run(tf.global_variables_initializer) should be sess.run(tf.global_variables_initializer())
this correct this error.

@eecrazy
Copy link

eecrazy commented Jan 16, 2017

I am running the code using latest version of tensorflow.

@GenTxt
Copy link
Author

GenTxt commented Jan 16, 2017

Thanks for the quick reply. I made the changes and the code is working fine now with the numeric data file. :)

The only issue remaining is the first one: #6

How does a user generate target_params.pkl to use with text file? Looking forward to your reply.

I tried processing a small text corpus with the existing target_params.pkl and it threw this error. Guess it was expecting numeric data.

Traceback (most recent call last):
File "sequence_gan.py", line 257, in
main()
File "sequence_gan.py", line 156, in main
gen_data_loader.create_batches(positive_file)
File "/home/aaron/Desktop/SeqGAN_tf_12_only/MLE_SeqGAN/gen_dataloader.py", line 15, in create_batches
parse_line = [int(x) for x in line]
ValueError: invalid literal for int() with base 10: 'First'

@eecrazy
Copy link

eecrazy commented Jan 23, 2017

@GenTxt please refer to question #6.

@LantaoYu LantaoYu closed this as completed Feb 6, 2017
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

3 participants