class_docstr: This class is intended for the ResDNN Histology Network model.
class_docstr_tok: ["This","class","is","intended","for","the","ResDNN","Histology","Network","model","."]
docstr: Load the custom pre-training weights to use for the fitting.
  Will not work if the declared SH_ORDER does not match the weights
  expected input.
  
  The weights for a sh_order of 8 can be obtained via the function:
      get_fnames('histo_resdnn_weights').
  
  Parameters
  ----------
  weights_path : str
      Path to the file containing the weights (hdf5, saved by tensorflow)
docstr_tok: ["Load","the","custom","pre-training","weights","to","use","for","the","fitting",".","Will","not","work","if","the","declared","SH_ORDER","does","not","match","the","weights","expected","input",".","The","weights","for","a","sh_order","of","8","can","be","obtained","via","the","function",":","get_fnames","(","'histo_resdnn_weights","'",")",".","Parameters","--","--","--","--","--","weights_path",":","str","Path","to","the","file","containing","the","weights","(","hdf5",",","saved","by","tensorflow",")"]
code: def load_model_weights(self, weights_path):
      r"""
      Load the custom pre-training weights to use for the fitting.
      Will not work if the declared SH_ORDER does not match the weights
      expected input.
  
      The weights for a sh_order of 8 can be obtained via the function:
          get_fnames('histo_resdnn_weights').
  
      Parameters
      ----------
      weights_path : str
          Path to the file containing the weights (hdf5, saved by tensorflow)
      """
      try:
          self.model.load_weights(weights_path)
      except ValueError:
          raise ValueError(
              "Expected input for the provided model weights "
              "do not match the declared model ({})".format(
                  self.sh_size
              )
          )
  
file_path: dipy/dipy/nn/histo_resdnn.py
imports: import logging
  import numpy
  from dipy.core.gradients import unique_bvals_magnitude, get_bval_indices
  from dipy.core.sphere import HemiSphere
  from dipy.data import get_sphere, get_fnames
  from dipy.reconst.shm import sf_to_sh, sh_to_sf, sph_harm_ind_list
  from dipy.testing.decorators import doctest_skip_parser
  from dipy.utils.optpkg import optional_package
  from dipy.nn.utils import set_logger_level
label_desc: Use image node_id 3 for calling the HistoResDNN obj's underlying member method code with example usage: obj.load_model_weights(weights_path) without return types