module 'tensorflow' has no attribute 'run'












0














Code:



import numpy as np
import tensorflow as tf


a3dim = np.array([[[1,2],[3,4]],
[[5,6],[7,8]]
])

print("a3dim Shape: ", a3dim.shape)

tf_t=tf.convert_to_tensor(a3dim,dtype=tf.float64)

print('tf_t : ',tf_t)
print('tf_t[0][0][0] : ',tf_t[0][0][0])
print('tf_t[1][1][1] : ',tf_t[1][1][1])

print('run(tf_t) : n', tf.run(tf_t))


When I run this program, I have the following error:



Error:



AttributeError                            Traceback (most recent call last)
<ipython-input-9-3506c45f6784> in <module>()
15 print('tf_t[1][1][1] : ',tf_t[1][1][1])
16
---> 17 print('run(tf_t) : n', tf.run(tf_t))

AttributeError: module 'tensorflow' has no attribute 'run'


How do I solve this tensorflow issue?
Is it a version problem?










share|improve this question





























    0














    Code:



    import numpy as np
    import tensorflow as tf


    a3dim = np.array([[[1,2],[3,4]],
    [[5,6],[7,8]]
    ])

    print("a3dim Shape: ", a3dim.shape)

    tf_t=tf.convert_to_tensor(a3dim,dtype=tf.float64)

    print('tf_t : ',tf_t)
    print('tf_t[0][0][0] : ',tf_t[0][0][0])
    print('tf_t[1][1][1] : ',tf_t[1][1][1])

    print('run(tf_t) : n', tf.run(tf_t))


    When I run this program, I have the following error:



    Error:



    AttributeError                            Traceback (most recent call last)
    <ipython-input-9-3506c45f6784> in <module>()
    15 print('tf_t[1][1][1] : ',tf_t[1][1][1])
    16
    ---> 17 print('run(tf_t) : n', tf.run(tf_t))

    AttributeError: module 'tensorflow' has no attribute 'run'


    How do I solve this tensorflow issue?
    Is it a version problem?










    share|improve this question



























      0












      0








      0







      Code:



      import numpy as np
      import tensorflow as tf


      a3dim = np.array([[[1,2],[3,4]],
      [[5,6],[7,8]]
      ])

      print("a3dim Shape: ", a3dim.shape)

      tf_t=tf.convert_to_tensor(a3dim,dtype=tf.float64)

      print('tf_t : ',tf_t)
      print('tf_t[0][0][0] : ',tf_t[0][0][0])
      print('tf_t[1][1][1] : ',tf_t[1][1][1])

      print('run(tf_t) : n', tf.run(tf_t))


      When I run this program, I have the following error:



      Error:



      AttributeError                            Traceback (most recent call last)
      <ipython-input-9-3506c45f6784> in <module>()
      15 print('tf_t[1][1][1] : ',tf_t[1][1][1])
      16
      ---> 17 print('run(tf_t) : n', tf.run(tf_t))

      AttributeError: module 'tensorflow' has no attribute 'run'


      How do I solve this tensorflow issue?
      Is it a version problem?










      share|improve this question















      Code:



      import numpy as np
      import tensorflow as tf


      a3dim = np.array([[[1,2],[3,4]],
      [[5,6],[7,8]]
      ])

      print("a3dim Shape: ", a3dim.shape)

      tf_t=tf.convert_to_tensor(a3dim,dtype=tf.float64)

      print('tf_t : ',tf_t)
      print('tf_t[0][0][0] : ',tf_t[0][0][0])
      print('tf_t[1][1][1] : ',tf_t[1][1][1])

      print('run(tf_t) : n', tf.run(tf_t))


      When I run this program, I have the following error:



      Error:



      AttributeError                            Traceback (most recent call last)
      <ipython-input-9-3506c45f6784> in <module>()
      15 print('tf_t[1][1][1] : ',tf_t[1][1][1])
      16
      ---> 17 print('run(tf_t) : n', tf.run(tf_t))

      AttributeError: module 'tensorflow' has no attribute 'run'


      How do I solve this tensorflow issue?
      Is it a version problem?







      tensorflow






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 12 at 11:36









      abunickabhi

      304214




      304214










      asked Nov 12 at 10:00









      Ilse

      217




      217
























          2 Answers
          2






          active

          oldest

          votes


















          0














          import numpy as np
          import tensorflow as tf


          a3dim = np.array([[[1,2],[3,4]],
          [[5,6],[7,8]]
          ])

          print("a3dim Shape: ", a3dim.shape)

          tf_t=tf.convert_to_tensor(a3dim,dtype=tf.float64)

          print('tf_t : ',tf_t)
          print('tf_t[0][0][0] : ',tf_t[0][0][0])
          print('tf_t[1][1][1] : ',tf_t[1][1][1])
          sess=tf.Session()#create session
          print('run(tf_t) : n', sess.run(tf_t))
          sess.close()#close session


          Tensorflow needs graph and Session to compute. The first step of the startup graph is to create a Session object. If there are no creation parameters, the Session builder will start the default graph. Session manages all resources of the TensorFlow program runtime. The Session needs to be closed after all calculations are completed to help the system recycle resources, otherwise the problem of resource leakage may occur.






          share|improve this answer





























            0














            you have to first create a session to run tf_t then something like session.run(tf_t) would work.






            share|improve this answer





















            • added with tf_t.Session() as tfs print('run(tf_t) : n', tfs.run(tf_t)) I have now as error: File "<ipython-input-34-19330f20e031>", line 17 with tf_t.Session() as tfs ^ SyntaxError: invalid syntax
              – Ilse
              Nov 12 at 11:54













            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53259746%2fmodule-tensorflow-has-no-attribute-run%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            import numpy as np
            import tensorflow as tf


            a3dim = np.array([[[1,2],[3,4]],
            [[5,6],[7,8]]
            ])

            print("a3dim Shape: ", a3dim.shape)

            tf_t=tf.convert_to_tensor(a3dim,dtype=tf.float64)

            print('tf_t : ',tf_t)
            print('tf_t[0][0][0] : ',tf_t[0][0][0])
            print('tf_t[1][1][1] : ',tf_t[1][1][1])
            sess=tf.Session()#create session
            print('run(tf_t) : n', sess.run(tf_t))
            sess.close()#close session


            Tensorflow needs graph and Session to compute. The first step of the startup graph is to create a Session object. If there are no creation parameters, the Session builder will start the default graph. Session manages all resources of the TensorFlow program runtime. The Session needs to be closed after all calculations are completed to help the system recycle resources, otherwise the problem of resource leakage may occur.






            share|improve this answer


























              0














              import numpy as np
              import tensorflow as tf


              a3dim = np.array([[[1,2],[3,4]],
              [[5,6],[7,8]]
              ])

              print("a3dim Shape: ", a3dim.shape)

              tf_t=tf.convert_to_tensor(a3dim,dtype=tf.float64)

              print('tf_t : ',tf_t)
              print('tf_t[0][0][0] : ',tf_t[0][0][0])
              print('tf_t[1][1][1] : ',tf_t[1][1][1])
              sess=tf.Session()#create session
              print('run(tf_t) : n', sess.run(tf_t))
              sess.close()#close session


              Tensorflow needs graph and Session to compute. The first step of the startup graph is to create a Session object. If there are no creation parameters, the Session builder will start the default graph. Session manages all resources of the TensorFlow program runtime. The Session needs to be closed after all calculations are completed to help the system recycle resources, otherwise the problem of resource leakage may occur.






              share|improve this answer
























                0












                0








                0






                import numpy as np
                import tensorflow as tf


                a3dim = np.array([[[1,2],[3,4]],
                [[5,6],[7,8]]
                ])

                print("a3dim Shape: ", a3dim.shape)

                tf_t=tf.convert_to_tensor(a3dim,dtype=tf.float64)

                print('tf_t : ',tf_t)
                print('tf_t[0][0][0] : ',tf_t[0][0][0])
                print('tf_t[1][1][1] : ',tf_t[1][1][1])
                sess=tf.Session()#create session
                print('run(tf_t) : n', sess.run(tf_t))
                sess.close()#close session


                Tensorflow needs graph and Session to compute. The first step of the startup graph is to create a Session object. If there are no creation parameters, the Session builder will start the default graph. Session manages all resources of the TensorFlow program runtime. The Session needs to be closed after all calculations are completed to help the system recycle resources, otherwise the problem of resource leakage may occur.






                share|improve this answer












                import numpy as np
                import tensorflow as tf


                a3dim = np.array([[[1,2],[3,4]],
                [[5,6],[7,8]]
                ])

                print("a3dim Shape: ", a3dim.shape)

                tf_t=tf.convert_to_tensor(a3dim,dtype=tf.float64)

                print('tf_t : ',tf_t)
                print('tf_t[0][0][0] : ',tf_t[0][0][0])
                print('tf_t[1][1][1] : ',tf_t[1][1][1])
                sess=tf.Session()#create session
                print('run(tf_t) : n', sess.run(tf_t))
                sess.close()#close session


                Tensorflow needs graph and Session to compute. The first step of the startup graph is to create a Session object. If there are no creation parameters, the Session builder will start the default graph. Session manages all resources of the TensorFlow program runtime. The Session needs to be closed after all calculations are completed to help the system recycle resources, otherwise the problem of resource leakage may occur.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 12 at 11:45









                myhaspldeep

                16017




                16017

























                    0














                    you have to first create a session to run tf_t then something like session.run(tf_t) would work.






                    share|improve this answer





















                    • added with tf_t.Session() as tfs print('run(tf_t) : n', tfs.run(tf_t)) I have now as error: File "<ipython-input-34-19330f20e031>", line 17 with tf_t.Session() as tfs ^ SyntaxError: invalid syntax
                      – Ilse
                      Nov 12 at 11:54


















                    0














                    you have to first create a session to run tf_t then something like session.run(tf_t) would work.






                    share|improve this answer





















                    • added with tf_t.Session() as tfs print('run(tf_t) : n', tfs.run(tf_t)) I have now as error: File "<ipython-input-34-19330f20e031>", line 17 with tf_t.Session() as tfs ^ SyntaxError: invalid syntax
                      – Ilse
                      Nov 12 at 11:54
















                    0












                    0








                    0






                    you have to first create a session to run tf_t then something like session.run(tf_t) would work.






                    share|improve this answer












                    you have to first create a session to run tf_t then something like session.run(tf_t) would work.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 12 at 10:40









                    D.negn

                    364




                    364












                    • added with tf_t.Session() as tfs print('run(tf_t) : n', tfs.run(tf_t)) I have now as error: File "<ipython-input-34-19330f20e031>", line 17 with tf_t.Session() as tfs ^ SyntaxError: invalid syntax
                      – Ilse
                      Nov 12 at 11:54




















                    • added with tf_t.Session() as tfs print('run(tf_t) : n', tfs.run(tf_t)) I have now as error: File "<ipython-input-34-19330f20e031>", line 17 with tf_t.Session() as tfs ^ SyntaxError: invalid syntax
                      – Ilse
                      Nov 12 at 11:54


















                    added with tf_t.Session() as tfs print('run(tf_t) : n', tfs.run(tf_t)) I have now as error: File "<ipython-input-34-19330f20e031>", line 17 with tf_t.Session() as tfs ^ SyntaxError: invalid syntax
                    – Ilse
                    Nov 12 at 11:54






                    added with tf_t.Session() as tfs print('run(tf_t) : n', tfs.run(tf_t)) I have now as error: File "<ipython-input-34-19330f20e031>", line 17 with tf_t.Session() as tfs ^ SyntaxError: invalid syntax
                    – Ilse
                    Nov 12 at 11:54




















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53259746%2fmodule-tensorflow-has-no-attribute-run%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Florida Star v. B. J. F.

                    Error while running script in elastic search , gateway timeout

                    Adding quotations to stringified JSON object values