leon zhu
leon zhu
个人认为所有中文应该都转成 unicode。一个中文字符长度为3,应该只是中文字符对应的unicode再对应的utf-8编码。
GPU 并不是必须的。 可以搞个 flag_cuda=torch.cuda.is_available() 然后基于这个 flag_cuda决定是否要对 model, tensor等 进行 cuda() 调用
GPU 并不是必须的。 可以搞个 flag_cuda=torch.cuda.is_available() 然后基于这个 flag_cuda决定是否要对 model, tensor等 进行 cuda() 调用
Maybe you need to modify the 'nclass' to satisfy the pre-trained model. model = crnn.CRNN(opt.imgH, nc, nclass, opt.nh)
我修改后的代码中有句 self.nclass = len(self.alphabet) + 1 self.converter = utils.strLabelConverter(self.alphabet) self.model = CRNN(self.image_height, 3, self.nclass, self.hidden_size, self.bone) ndclass 是你的字典长度加1,看原代码的注释,加1应该是 CTCLoss 要求的,即增加一个,表明“无效字符” 你拿到的 pretrained model,要看一下这个 model 用的 alphabet是不是跟你用的是相同的。
--random_sample
maybe it's 0.3. For 0.4, you need modify some code lines, such as: #preds = preds.squeeze(2)