this is the used load_weight function:
def load_weights(G, D, state_dict, weights_root, experiment_name,config, epoch_id = '',
                 name_suffix=None, G_ema=None, strict=True, load_optim=True):
  #"/dlc/Employees/esc2rng/biggan_abst/56932_1708_c_ctrl/weights"
  #root = '/'.join([weights_root, experiment_name])
  #root = "/dlc/Employees/esc2rng/biggan_abst/56932_1708_c_ctrl/weights/BigGAN_coco_seed0_Gch64_Dch64_bs64_Glr5.0e-05_Dlr2.0e-04_Gnlrelu_Dnlrelu_Ginitortho_Dinitortho_Gattn64_Dattn64/"
  root = config["resume_from"]
  if name_suffix:
    print('Loading %s weights from %s...' % (name_suffix, root))
  else:
    print('Loading weights from %s...' % root)
  print("epoch id : ", epoch_id)
  if G is not None:
    G.load_state_dict(
      torch.load('%s/%s.pth' % (root, join_strings('_', ['G', epoch_id,  name_suffix]))),
      strict=strict)
    if load_optim:
      s = torch.load('%s/%s.pth' % (root, join_strings('_', ['G_optim', epoch_id,  name_suffix])))
      print(">>" , len(s))
      #print(s)
      G.optim.load_state_dict(
        torch.load('%s/%s.pth' % (root, join_strings('_', ['G_optim', epoch_id,  name_suffix]))))
  if D is not None:
    D.load_state_dict(
      torch.load('%s/%s.pth' % (root, join_strings('_', ['D', epoch_id,  name_suffix]))),
      strict=strict)
    if load_optim:
      D.optim.load_state_dict(
        torch.load('%s/%s.pth' % (root, join_strings('_', ['D_optim', epoch_id,  name_suffix]))))
  # Load state dict
  for item in state_dict:
    D = torch.load('%s/%s.pth' % (root, join_strings('_', ['state_dict', epoch_id,  name_suffix])))
    if item in D:
      state_dict[item] = D[item]
    else:
      print(item, " not in state_dict, creating it ...")
      state_dict[item] = []

  if G_ema is not None:
    G_ema.load_state_dict(
      torch.load('%s/%s.pth' % (root, join_strings('_', ['G_ema', epoch_id, name_suffix]))),
      strict=strict)