Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-8928

Error with "argv" in testKeras* Programs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 6.10/02
    • Fix Version/s: 6.12/00, 6.10/04
    • Component/s: Testing, TMVA
    • Labels:
      None
    • Environment:

      Description

      I have installed Root and I'm attempting to test the Keras programs (testPyKeras*) found in root/tmva/pymva/test, but I encounter the following error:

      AttributeError: 'module' object has no attribute 'argv'

      This occurs whether I run the tests directly from the root source directory (root/tmva/pymva/test) after building Root via the standard instructions [0] or if I follow the instructions to build Root in a way that compiles the tests [1]. A bit of searching leads to the possibility that it's due to the Python being embedded [2], but that seems unlikely since it's part of the testing suite.

      I've tried this under several other operating systems (macOS Sierra, Ubuntu 16.04) and versions of Keras/TensorFlow, so I am stuck as to what the problem with my environment could be. Any help would be appreciated.

      I've included the error message from attempts from the two different Root builds under RHEL7. If there is any other information that I can provide to help resolve this issue, I will gladly do so.

      Thank you,

      Jamal

      [0] Standard instructions: https://root.cern.ch/building-root
      [1] Building Root with tests: https://root.cern.ch/how/running-root-tests
      [2] Called Python Code: https://github.com/google/oauth2client/issues/642

      [ec2-user@ip-172-31-28-125 test]$ root -l testPyKerasRegression.C
      root [0]
      Processing testPyKerasRegression.C...
      Get test data...
      Generate keras model...
      Using TensorFlow backend.
      2017-07-25 15:36:17.809371: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
      2017-07-25 15:36:17.809402: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
      2017-07-25 15:36:17.809409: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
      2017-07-25 15:36:17.809415: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
      2017-07-25 15:36:17.809421: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
      Setup TMVA...
      Using TensorFlow backend.
      Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib64/python2.7/site-packages/keras/_init_.py", line 2, in <module>
      from . import backend
      File "/usr/lib64/python2.7/site-packages/keras/backend/_init_.py", line 67, in <module>
      from .tensorflow_backend import *
      File "/usr/lib64/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 1, in <module>
      import tensorflow as tf
      File "/usr/lib/python2.7/site-packages/tensorflow/_init_.py", line 24, in <module>
      from tensorflow.python import *
      File "/usr/lib/python2.7/site-packages/tensorflow/python/_init_.py", line 98, in <module>
      from tensorflow.python.platform import app
      File "/usr/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 23, in <module>
      from tensorflow.python.platform import flags
      File "/usr/lib/python2.7/site-packages/tensorflow/python/platform/flags.py", line 25, in <module>
      _global_parser = _argparse.ArgumentParser()
      File "/usr/lib64/python2.7/argparse.py", line 1573, in _init_
      prog = _os.path.basename(_sys.argv[0])
      AttributeError: 'module' object has no attribute 'argv'
      <FATAL> : Import Keras failed
      ***> abort program execution
      terminate called after throwing an instance of 'std::runtime_error'
      what(): FATAL error

      *****************************************************

      [ec2-user@ip-172-31-28-125 test]$ ./testPyKerasClassification
      Get test data...
      Generate keras model...
      Using TensorFlow backend.
      2017-07-25 03:03:52.718041: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
      2017-07-25 03:03:52.718076: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
      2017-07-25 03:03:52.718084: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
      2017-07-25 03:03:52.718091: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
      2017-07-25 03:03:52.718097: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
      Setup TMVA...
      Using TensorFlow backend.
      Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib64/python2.7/site-packages/keras/_init_.py", line 2, in <module>
      from . import backend
      File "/usr/lib64/python2.7/site-packages/keras/backend/_init_.py", line 67, in <module>
      from .tensorflow_backend import *
      File "/usr/lib64/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 1, in <module>
      import tensorflow as tf
      File "/usr/lib/python2.7/site-packages/tensorflow/_init_.py", line 24, in <module>
      from tensorflow.python import *
      File "/usr/lib/python2.7/site-packages/tensorflow/python/_init_.py", line 98, in <module>
      from tensorflow.python.platform import app
      File "/usr/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 23, in <module>
      from tensorflow.python.platform import flags
      File "/usr/lib/python2.7/site-packages/tensorflow/python/platform/flags.py", line 25, in <module>
      _global_parser = _argparse.ArgumentParser()
      File "/usr/lib64/python2.7/argparse.py", line 1573, in _init_
      prog = _os.path.basename(_sys.argv[0])
      AttributeError: 'module' object has no attribute 'argv'
      <FATAL> : Import Keras failed
      ***> abort program execution
      terminate called after throwing an instance of 'std::runtime_error'
      what(): FATAL error
      Aborted

        Attachments

          Activity

            People

            Assignee:
            mato Pere Mato Vila
            Reporter:
            jrorie Jamal Tildon Rorie (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Actual End: