Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

predict.py测试出现问题 #74

Open
Debugerss opened this issue Apr 26, 2020 · 12 comments
Open

predict.py测试出现问题 #74

Debugerss opened this issue Apr 26, 2020 · 12 comments

Comments

@Debugerss
Copy link

我想直接拿作者的predict函数来测试效果。但是在模型加载的时候出现模型key值不匹配的问题,怎么解决

@WenmuZhou
Copy link
Owner

能否贴下报错信息

@Debugerss
Copy link
Author

RuntimeError: Error(s) in loading state_dict for PSENet:
Missing key(s) in state_dict: "toplayer.0.weight", "toplayer.0.bias", "toplayer.1.weight", "toplayer.1.bias", "toplayer.1.running_mean", "toplayer.1.running_var", "latlayer1.0.weight", "latlayer1.0.bias", "latlayer1.1.weight", "latlayer1.1.bias", "latlayer1.1.running_mean", "latlayer1.1.running_var", "latlayer2.0.weight", "latlayer2.0.bias", "latlayer2.1.weight", "latlayer2.1.bias", "latlayer2.1.running_mean", "latlayer2.1.running_var", "latlayer3.0.weight", "latlayer3.0.bias", "latlayer3.1.weight", "latlayer3.1.bias", "latlayer3.1.running_mean", "latlayer3.1.running_var", "smooth1.0.weight", "smooth1.0.bias", "smooth1.1.weight", "smooth1.1.bias", "smooth1.1.running_mean", "smooth1.1.running_var", "smooth2.0.weight", "smooth2.0.bias", "smooth2.1.weight", "smooth2.1.bias", "smooth2.1.running_mean", "smooth2.1.running_var", "smooth3.0.weight", "smooth3.0.bias", "smooth3.1.weight", "smooth3.1.bias", "smooth3.1.running_mean", "smooth3.1.running_var".
Unexpected key(s) in state_dict: "toplayer.weight", "toplayer.bias", "latlayer1.weight", "latlayer1.bias", "latlayer2.weight", "latlayer2.bias", "latlayer3.weight", "latlayer3.bias", "smooth1.weight", "smooth1.bias", "smooth2.weight", "smooth2.bias", "smooth3.weight", "smooth3.bias".

@Debugerss
Copy link
Author

我用的是您网盘里的resnet50的模型,还请您指教

@WenmuZhou
Copy link
Owner

这个 这样的,网络结构我改了下,网盘里的模型就不能用了

@Debugerss
Copy link
Author

哦,好吧,谢谢您耐心的回答
不知您是否可以上传一个可以预测的模型,我想测试一下环境是否有问题,方便后期训练

@WenmuZhou
Copy link
Owner

我手上目前没有可用的模型,不好意思

@Debugerss
Copy link
Author

if label == '' or label == '###':
text_tags.append(True)
else:
text_tags.append(False)
您好,这句话的意思是,标签为“###”或者“
”的加入训练,
否则就不加入训练,是吗?

@WenmuZhou
Copy link
Owner

不是,是相反的意思

@Debugerss
Copy link
Author

您好,训练输入图像的尺寸是利用config文件里面的data_shape = 1280控制吗?
测试时输入图像的尺寸,默认2240是吗? long_size: int = 2240):
想找hub主确认一下

@WenmuZhou
Copy link
Owner

是的

@Debugerss
Copy link
Author

如果我设定data_shape = 1280,那输入图像的尺寸为什么是12801280
作者处理输入图像的代码是这个吗?
img, score_maps, training_mask = image_label(img_path, text_polys, text_tags, input_size=self.data_shape, n=self.n, m=self.m)
然后跳进image_label里面,
imgs = data_aug.random_crop_author([im, score_maps.transpose((1, 2, 0)),training_mask], (input_size, input_size))
我分析输入图像尺寸是1280
1280,是不是因为您在这里crop了一下

@Debugerss
Copy link
Author

楼主,我在训练了一半之后,停电了,想继续训练,修改如下:
#checkpoint = '' checkpoint = '/dahuafs/userdata/01_PDF/01_PSENet/output/psenet_icd2015_resnet152_4gpu_author_crop_adam_MultiStepLR_authorloss/PSENet_36_loss0.055750.pth'
restart_training = False

#start_epoch = 0
start_epoch = 37
但是在训练的时候碰到,
PermissionError: [Errno 13] Permission denied: 'train_log'

请问怎么解决一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants