tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

Avoid deeply nested control flow statements.
Open

          for i in range(start_ndx, end_ndx):
            sys.stdout.write('\r>> Converting image %d/%d shard %d' % (
                i+1, len(filenames), shard_id))
            sys.stdout.flush()

Severity: Major
Found in research/slim/datasets/download_and_convert_flowers.py - About 45 mins to fix

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

    def pad_to_bounding_box(image, offset_height, offset_width, target_height,
    Severity: Minor
    Found in research/deeplab/core/preprocess_utils.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                if output_stride is not None and current_stride == output_stride:
                  net = block.unit_fn(net, rate=rate, **dict(unit, stride=1))
                  rate *= unit.get('stride', 1)
                else:
                  net = block.unit_fn(net, rate=1, **unit)
      Severity: Major
      Found in research/deeplab/core/xception.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                  with slim.arg_scope(
                      [xception_module],
                      use_bounded_activation=use_bounded_activation,
                      use_explicit_padding=not use_bounded_activation) as arg_sc:
                    return arg_sc
        Severity: Major
        Found in research/deeplab/core/xception.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, 96, [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, 160, [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, 24, [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_1'):
                            branch_1 = slim.conv2d(net, 160, [1, 1], scope='Conv2d_0a_1x1')
                            branch_1 = slim.conv2d(branch_1, 320, [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

                            if spatial_squeeze:
                              net = tf.squeeze(net, [1, 2], name='SpatialSqueeze')
                              end_points[sc.name + '/spatial_squeeze'] = net
                            end_points['predictions'] = slim.softmax(net, scope='predictions')
                  Severity: Major
                  Found in research/slim/nets/resnet_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/alexnet.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_2'):
                                    branch_2 = slim.conv2d(net, 32, [1, 1], scope='Conv2d_0a_1x1')
                                    branch_2 = slim.conv2d(branch_2, 128, [3, 3], scope='Conv2d_0a_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

                                  if bbox.label != label:
                                    # Note: There is a slight bug in the bounding box annotation data.
                                    # Many of the dog labels have the human label 'Scottish_deerhound'
                                    # instead of the synset ID 'n02092002' in the bbox.label field. As a
                                    # simple hack to overcome this issue, we only exclude bbox labels
                          Severity: Major
                          Found in research/slim/datasets/process_bounding_boxes.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                        if output_stride is None:
                                          factor = 1
                                        else:
                                          factor = nominal_stride // output_stride
                                        output = resnet_utils.subsample(output, factor)
                            Severity: Major
                            Found in research/slim/nets/resnet_v2_test.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, 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

                                Avoid deeply nested control flow statements.
                                Open

                                          with tf.variable_scope('AuxLogits'):
                                            aux_logits = slim.avg_pool2d(
                                                aux_logits, [5, 5], stride=3, padding='VALID',
                                                scope='AvgPool_1a_5x5')
                                            aux_logits = slim.conv2d(aux_logits, depth(128), [1, 1],
                                Severity: Major
                                Found in research/slim/nets/inception_v3.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, 32, [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_1'):
                                                branch_1 = slim.conv2d(net, 144, [1, 1], scope='Conv2d_0a_1x1')
                                                branch_1 = slim.conv2d(branch_1, 288, [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_1'):
                                                  branch_1 = slim.conv2d(net, 160, [1, 1], scope='Conv2d_0a_1x1')
                                                  branch_1 = slim.conv2d(branch_1, 320, [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

                                                  if spatial_squeeze:
                                                    net = tf.squeeze(net, [1, 2], name='SpatialSqueeze')
                                                    end_points[sc.name + '/spatial_squeeze'] = net
                                                  end_points['predictions'] = slim.softmax(net, scope='predictions')
                                        Severity: Major
                                        Found in research/slim/nets/resnet_v2.py - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language