Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: run() missing 1 required positional argument: 'fetches' on Session.run()

I'm new at tensorflow and I'm trying to follow this getting started tutorial. But executing this very simple code within "ex001.py" script:

import tensorflow as tf

sess = tf.Session
hello = tf.constant('Hello, TensorFlow!')
print(hello)
print(sess.run(hello))

I get the following output

Tensor("Const:0", shape=(), dtype=string) Traceback (most recent call last): File "C:\Users\Giuseppe\Desktop\ex001.py", line 6, in print(sess.run(hello)) TypeError: run() missing 1 required positional argument: 'fetches'

I've checked the tf.Session.run() syntax but looks right and I didn't find anyone with the same issue.

I'm running with this configuration:

  • Windows 7 Professional sp1 64 bit
  • Python 3.5.3 64 bit
  • Tensorflow 1.0.1 cpu version

Thanks in advance

like image 694
ggagliano Avatar asked Mar 17 '17 12:03

ggagliano


1 Answers

Not sess = tf.Session, it should be tf.Session(), you are missing ()

like image 114
xxi Avatar answered Oct 31 '22 15:10

xxi