class_docstr: Trainer.
  
  Generic class to handle any TensorFlow graph training. It requires
  the use of `TrainOp` to specify all optimization parameters.
  
  Arguments:
      train_ops: list of `TrainOp`. A list of a network training
          operations for performing optimizations.
      graph: `tf.Graph`. The TensorFlow graph to use. Default: default tf
          graph.
      clip_gradients: `float`. Clip gradient. Default: 5.0.
      tensorboard_dir: `str`. Tensorboard log directory.
          Default: "/tmp/tflearn_logs/".
      tensorboard_verbose: `int`. Verbose level. It supports:
          ```python
          0 - Loss, Accuracy. (Best Speed)
          1 - Loss, Accuracy, Gradients.
          2 - Loss, Accuracy, Gradients, Weights.
          3 - Loss, Accuracy, Gradients, Weights, Activations, Sparsity.
              (Best Visualization)
          ```
      checkpoint_path: `str`. Path to store model checkpoints. If None,
          no model checkpoint will be saved. Default: None.
      best_checkpoint_path: `str`. Path to store the model when the validation rate reaches its
          highest point of the current training session and also is above best_val_accuracy. Default: None.
      max_checkpoints: `int` or None. Maximum amount of checkpoints. If
          None, no limit. Default: None.
      keep_checkpoint_every_n_hours: `float`. Number of hours between each
          model checkpoints.
      random_seed: `int`. Random seed, for test reproductivity.
          Default: None.
      session: `Session`. A session for running ops. If None, a new one will
          be created. Note: When providing a session, variables must have been
          initialized already, otherwise an error will be raised.
      best_val_accuracy: `float` The minimum validation accuracy that needs to be
          achieved before a model weight's are saved to the best_checkpoint_path. This
          allows the user to skip early saves and also set a minimum save point when continuing
          to train a reloaded model. Default: 0.0.
class_docstr_tok: ["Trainer",".","Generic","class","to","handle","any","TensorFlow","graph","training",".","It","requires","the","use","of","`","TrainOp","`","to","specify","all","optimization","parameters",".","Arguments",":","train_ops",":","list","of","`","TrainOp","`",".","A","list","of","a","network","training","operations","for","performing","optimizations",".","graph",":","`","tf.Graph","`",".","The","TensorFlow","graph","to","use",".","Default",":","default","tf","graph",".","clip_gradients",":","`","float","`",".","Clip","gradient",".","Default",":","5.0.","tensorboard_dir",":","`","str","`",".","Tensorboard","log","directory",".","Default",":","``","\/tmp\/tflearn_logs\/","''",".","tensorboard_verbose",":","`","int","`",".","Verbose","level",".","It","supports",":","``","`","python","0","-","Loss",",","Accuracy",".","(","Best","Speed",")","1","-","Loss",",","Accuracy",",","Gradients",".","2","-","Loss",",","Accuracy",",","Gradients",",","Weights",".","3","-","Loss",",","Accuracy",",","Gradients",",","Weights",",","Activations",",","Sparsity",".","(","Best","Visualization",")","``","`","checkpoint_path",":","`","str","`",".","Path","to","store","model","checkpoints",".","If","None",",","no","model","checkpoint","will","be","saved",".","Default",":","None",".","best_checkpoint_path",":","`","str","`",".","Path","to","store","the","model","when","the","validation","rate","reaches","its","highest","point","of","the","current","training","session","and","also","is","above","best_val_accuracy",".","Default",":","None",".","max_checkpoints",":","`","int","`","or","None",".","Maximum","amount","of","checkpoints",".","If","None",",","no","limit",".","Default",":","None",".","keep_checkpoint_every_n_hours",":","`","float","`",".","Number","of","hours","between","each","model","checkpoints",".","random_seed",":","`","int","`",".","Random","seed",",","for","test","reproductivity",".","Default",":","None",".","session",":","`","Session","`",".","A","session","for","running","ops",".","If","None",",","a","new","one","will","be","created",".","Note",":","When","providing","a","session",",","variables","must","have","been","initialized","already",",","otherwise","an","error","will","be","raised",".","best_val_accuracy",":","`","float","`","The","minimum","validation","accuracy","that","needs","to","be","achieved","before","a","model","weight","'s","are","saved","to","the","best_checkpoint_path",".","This","allows","the","user","to","skip","early","saves","and","also","set","a","minimum","save","point","when","continuing","to","train","a","reloaded","model",".","Default",":","0.0","."]
docstr: Give names to all TrainOp, handle no names and duplicated names 
code: def validate_trainop_names(self):
      """Give names to all TrainOp, handle no names and duplicated names"""
      t_len = len(self.train_ops)
      # Rename optimizers without name
      for i in range(t_len):
          if not self.train_ops[i].name:
              self.train_ops[i].name = "Optimizer"
              self.train_ops[i].scope_name = "Optimizer"
      # Handle duplicate names
      for i in range(t_len):
          dupl = 0
          for j in range(i + 1, t_len):
              if not self.train_ops[i].name:
                  break
              if self.train_ops[i].name == self.train_ops[j].name:
                  if dupl == 0:
                      self.train_ops[i].name += "_" + str(dupl)
                      self.train_ops[i].scope_name = self.train_ops[
                          i
                      ].name
                  dupl += 1
                  self.train_ops[j].name += "_" + str(dupl)
                  self.train_ops[j].scope_name = self.train_ops[j].name
  
imports: from __future__ import division, print_function, absolute_import
  import re
  import os
  import numpy
  import tensorflow.compat.v1
  from tensorflow.python.training import optimizer
  import tflearn
  from ..None import callbacks
  from ..config import init_training_mode
  from ..utils import to_list, id_generator, check_dir_name, standarize_dict, get_dict_first_element, make_batches, slice_array, check_scope_path, check_restore_tensor
  from ..None import data_flow
  from ..None import variables
  from ..None import utils
  from .summarizer import summaries, summarize, summarize_gradients, summarize_variables, summarize_activations
label_desc: Use image node_id 7 for calling the Trainer obj's underlying member method code with example usage: obj.validate_trainop_names() without return types