tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

Avoid deeply nested control flow statements.
Open

          with tf.variable_scope('Branch_0'):
            branch_0 = slim.conv2d(net, 112, [1, 1], scope='Conv2d_0a_1x1')
          with tf.variable_scope('Branch_1'):
Severity: Major
Found in research/slim/nets/inception_v1.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

              with tf.variable_scope('Branch_2'):
                branch_2 = slim.conv2d(net, 32, [1, 1], scope='Conv2d_0a_1x1')
                branch_2 = slim.conv2d(branch_2, 64, [3, 3], scope='Conv2d_0b_3x3')
              with tf.variable_scope('Branch_3'):
    Severity: Major
    Found in research/slim/nets/inception_v1.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                with tf.variable_scope('Branch_0'):
                  branch_0 = slim.conv2d(net, 384, [1, 1], scope='Conv2d_0a_1x1')
                with tf.variable_scope('Branch_1'):
      Severity: Major
      Found in research/slim/nets/inception_v1.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                  with tf.variable_scope('Branch_2'):
                    branch_2 = slim.conv2d(net, 48, [1, 1], scope='Conv2d_0a_1x1')
                    branch_2 = slim.conv2d(branch_2, 128, [3, 3], scope='Conv2d_0b_3x3')
                  with tf.variable_scope('Branch_3'):
        Severity: Major
        Found in research/slim/nets/inception_v1.py - About 45 mins to fix

          Function cyclegan_upsample has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def cyclegan_upsample(net, num_outputs, stride, method='conv2d_transpose',
          Severity: Minor
          Found in research/slim/nets/cyclegan.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                      if final_endpoint == end_point:
                        return net, end_points
                      end_point = 'MaxPool_3a_3x3'
            Severity: Major
            Found in research/slim/nets/inception_v1.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                        with tf.variable_scope('Branch_2'):
                          branch_2 = slim.conv2d(net, 16, [1, 1], scope='Conv2d_0a_1x1')
                          branch_2 = slim.conv2d(branch_2, 48, [3, 3], scope='Conv2d_0b_3x3')
                        with tf.variable_scope('Branch_3'):
              Severity: Major
              Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                          with tf.variable_scope('Branch_3'):
                            branch_3 = slim.max_pool2d(net, [3, 3], scope='MaxPool_0a_3x3')
                            branch_3 = slim.conv2d(branch_3, 64, [1, 1], scope='Conv2d_0b_1x1')
                          net = tf.concat(
                Severity: Major
                Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                            with tf.variable_scope('Branch_0'):
                              branch_0 = slim.conv2d(net, 256, [1, 1], scope='Conv2d_0a_1x1')
                            with tf.variable_scope('Branch_1'):
                  Severity: Major
                  Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                              if final_endpoint == end_point:
                                return net, end_points
                              end_point = 'Conv2d_2c_3x3'
                    Severity: Major
                    Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                with tf.variable_scope('Branch_3'):
                                  branch_3 = slim.max_pool2d(net, [3, 3], scope='MaxPool_0a_3x3')
                                  branch_3 = slim.conv2d(branch_3, 32, [1, 1], scope='Conv2d_0b_1x1')
                                net = tf.concat(
                      Severity: Major
                      Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                  with tf.variable_scope('Branch_3'):
                                    branch_3 = slim.max_pool2d(net, [3, 3], scope='MaxPool_0a_3x3')
                                    branch_3 = slim.conv2d(branch_3, 64, [1, 1], scope='Conv2d_0b_1x1')
                                  net = tf.concat(
                        Severity: Major
                        Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                    with tf.variable_scope('Branch_1'):
                                      branch_1 = slim.conv2d(net, 112, [1, 1], scope='Conv2d_0a_1x1')
                                      branch_1 = slim.conv2d(branch_1, 224, [3, 3], scope='Conv2d_0b_3x3')
                                    with tf.variable_scope('Branch_2'):
                          Severity: Major
                          Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                      with tf.variable_scope('Branch_3'):
                                        branch_3 = slim.max_pool2d(net, [3, 3], scope='MaxPool_0a_3x3')
                                        branch_3 = slim.conv2d(branch_3, 128, [1, 1], scope='Conv2d_0b_1x1')
                                      net = tf.concat(
                            Severity: Major
                            Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                              Function split_conv has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def split_conv(input_tensor,
                              Severity: Minor
                              Found in research/slim/nets/mobilenet/conv_blocks.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                          if final_endpoint == end_point:
                                            return net, end_points
                                
                                
                                Severity: Major
                                Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                            with tf.variable_scope('Branch_0'):
                                              branch_0 = slim.conv2d(net, 192, [1, 1], scope='Conv2d_0a_1x1')
                                            with tf.variable_scope('Branch_1'):
                                  Severity: Major
                                  Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                              if spatial_squeeze:
                                                net = tf.squeeze(net, [1, 2], name='fc8/squeezed')
                                              end_points[sc.name + '/fc8'] = net
                                    Severity: Major
                                    Found in research/slim/nets/overfeat.py - About 45 mins to fix

                                      Function mobilenet has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      def mobilenet(input_tensor,
                                                    num_classes=1001,
                                                    depth_multiplier=1.0,
                                                    scope='MobilenetV2',
                                                    conv_defs=None,
                                      Severity: Minor
                                      Found in research/slim/nets/mobilenet/mobilenet_v2.py - About 45 mins to fix

                                      Cognitive Complexity

                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                      A method's cognitive complexity is based on a few simple rules:

                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                      • Code is considered more complex for each "break in the linear flow of the code"
                                      • Code is considered more complex when "flow breaking structures are nested"

                                      Further reading

                                      Function conv2d_same has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                      def conv2d_same(inputs, num_outputs, kernel_size, stride, rate=1, scope=None):
                                      Severity: Minor
                                      Found in research/slim/nets/resnet_utils.py - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language