tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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/deeplab/core/conv2d_ws.py - About 45 mins to fix

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

    def preprocess_image(image,
    Severity: Minor
    Found in research/slim/preprocessing/cifarnet_preprocessing.py - About 45 mins to fix

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

      def pix2pix_discriminator(net, num_filters, padding=2, pad_mode='REFLECT',
      Severity: Minor
      Found in research/slim/nets/pix2pix.py - About 45 mins to fix

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

        def _build_pnasnet_base(images,
        Severity: Minor
        Found in research/slim/nets/nasnet/pnasnet.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                      with self.test_session() as sess:
                        tf.set_random_seed(0)
                        inputs = create_test_input(1, height, width, 3)
                        # Dense feature extraction followed by subsampling.
                        output = resnet_utils.stack_blocks_dense(inputs,
          Severity: Major
          Found in research/slim/nets/resnet_v2_test.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        if self._use_bounded_activation:
                          h = tf.nn.relu6(h)
            
                      # Add hiddenstate to the list of hiddenstates we can choose from
                      net.append(h)
            Severity: Major
            Found in research/slim/nets/nasnet/nasnet_utils.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/deeplab/core/resnet_v1_beta_test.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                          if output_stride % 2 != 0:
                            raise ValueError('The output_stride needs to be a multiple of 2.')
                          output_stride //= 2
                Severity: Major
                Found in research/deeplab/core/xception.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                              if current_config[_INPUT] < 0:
                                operation_input = features
                              else:
                                operation_input = branch_logits[current_config[_INPUT]]
                              if current_config[_OP] == _CONV:
                  Severity: Major
                  Found in research/deeplab/core/dense_prediction_cell.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                if current_config[_OP] == _CONV:
                                  if current_config[_KERNEL] == [1, 1] or current_config[
                                      _KERNEL] == 1:
                                    branch_logits.append(
                                        slim.conv2d(operation_input, depth, 1, scope=scope))
                    Severity: Major
                    Found in research/deeplab/core/dense_prediction_cell.py - About 45 mins to fix

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

                        def __call__(self, net, scope, filter_scaling, stride, prev_layer, cell_num):
                      Severity: Minor
                      Found in research/deeplab/core/nas_cell.py - About 45 mins to fix

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

                        def lenet(images, num_classes=10, is_training=False,
                        Severity: Minor
                        Found in research/slim/nets/lenet.py - About 45 mins to fix

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

                          def build_nasnet_mobile(images, num_classes,
                          Severity: Minor
                          Found in research/slim/nets/nasnet/nasnet.py - About 45 mins to fix

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

                            def restore_model(sess, checkpoint_path, enable_ema=True):
                              """Restore variables from the checkpoint into the provided session.
                            
                              Args:
                                sess: A tensorflow session where the checkpoint will be loaded.
                            Severity: Minor
                            Found in research/slim/nets/post_training_quantization.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 cifarnet has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def cifarnet(images, num_classes=10, is_training=False,
                            Severity: Minor
                            Found in research/slim/nets/cifarnet.py - About 45 mins to fix

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

                              def resolve_shape(tensor, rank=None, scope=None):
                                """Fully resolves the shape of a Tensor.
                              
                                Use as much as possible the shape components already known during graph
                                creation and resolve the remaining ones during runtime.
                              Severity: Minor
                              Found in research/deeplab/core/preprocess_utils.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 preprocess_for_train has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def preprocess_for_train(image,
                              Severity: Minor
                              Found in research/slim/preprocessing/vgg_preprocessing.py - About 45 mins to fix

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

                                  def _combine_unused_states(self, net):
                                    """Concatenate the unused hidden states of the cell."""
                                    used_hiddenstates = self._used_hiddenstates
                                
                                    final_height = int(net[-1].shape[2])
                                Severity: Minor
                                Found in research/slim/nets/nasnet/nasnet_utils.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 build_nasnet_large has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                def build_nasnet_large(images, num_classes,
                                Severity: Minor
                                Found in research/slim/nets/nasnet/nasnet.py - About 45 mins to fix

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

                                  def preprocess_for_train(image,
                                  Severity: Minor
                                  Found in research/slim/preprocessing/cifarnet_preprocessing.py - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language