cripac-sjx / SEA-T2F

Multi-caption Text-to-Face Synthesis: Database and Algorithm
30 stars 4 forks source link

i want figure out what the NetG #3

Open styufo opened 1 year ago

styufo commented 1 year ago

I want to know what the definition of the variable NetG is. It cannot be found in the code, which will cause the program to report an error.The code snippet appears in the function 'gen' in the file 'trainer. py' ` def gen_example(self, data_dic):

      if cfg.TRAIN.NET_G == '':
        print('Error: the path for models is not found!')
      else:
        text_encoder = RNN_ENCODER(self.n_words, nhidden=cfg.TEXT.EMBEDDING_DIM)
        state_dict = torch.load(cfg.TRAIN.NET_E, map_location=lambda storage, loc: storage)
        text_encoder.load_state_dict(state_dict)
        print('Load text encoder from:', cfg.TRAIN.NET_E)
        text_encoder = text_encoder.cuda()
        text_encoder.eval()

        checkpoint_path = "../models/netG_055.pth"
        netG0 = NetG(cfg.GAN.GF_DIM, 100)
        netG0.load_state_dict(torch.load(checkpoint_path))
        netG0 = netG0.cuda()
        netG0.eval()

`

code

RachelWang122 commented 1 year ago

Hello, I encountered the same problem,,Have you solved this problem yet? @styufo @cripac-sjx

styufo commented 1 year ago

@RachelWang122 I haven't been able to solve this problem. I found that the variable netG0 doesn't seem to be used in the future, so I tried to comment out this part, but there will still be errors about the tensor dimension mismatch later