Roy-海龙

Results 28 comments of Roy-海龙

class FCN_HRNet_W18_Face_Seg(nn.Layer): def __init__(self): super(FCN_HRNet_W18_Face_Seg, self).__init__() # 加载分割模型 self.seg = FCN(num_classes=2, backbone=HRNet_W18()) # 加载模型参数 state_dict = paddle.load(os.path.join(self.directory, 'seg_model_384.pdparams')) self.seg.set_state_dict(state_dict) # 设置模型为评估模式 self.seg.eval() # ============================================================ input_spec = paddle.static.InputSpec(shape=[None, 3, 384, 384],...

@KPatr1ck 非常感谢,已经成功。 就是在动转静模型的时候改: def SyncBatchNorm(*args, **kwargs): """In cpu environment nn.SyncBatchNorm does not have kernel so use nn.BatchNorm instead""" # if paddle.get_device() == 'cpu': return nn.BatchNorm(*args, **kwargs) # else: # return...

我也只尝试过几个模型,用 paddle2onnx,有些模型的算子需要调整,如 nn.SyncBatchNorm 改回 nn.BatchNorm。 hsliuyl ***@***.***> 于2022年6月17日周五 17:15写道: > 你好,请问下paddlehub里面的模型可以正常转onnx吗?我没有看明白你后面是怎么转成功的,我的微信:hsliuyl > > — > Reply to this email directly, view it on GitHub > , > or unsubscribe >...

不需要训练模型,hub里面的模型有些好像也不支持继续训练,加载模型的网络结构里面,该一下不支持的算子。 hsliuyl ***@***.***> 于2022年6月20日周一 11:01写道: > 我也只尝试过几个模型,用 paddle2onnx,有些模型的算子需要调整,如 nn.SyncBatchNorm 改回 nn.BatchNorm。 > hsliuyl *@*. > > *> 于2022年6月17日周五 17:15写道: … > 你好,请问下paddlehub里面的模型可以正常转onnx吗?我没有看明白你后面是怎么转成功的,我的微信:hsliuyl — Reply to > this email directly, view...

我也遇到这个问题,不过用另一种方式解决了。 https://blog.csdn.net/hailongzhang26/article/details/118937909

不确定这个修改是否正确,但是修改后训练正常 修改: # 模型网络输出层修改 ppocr.modeling.backbones.vqa_layoutlm class LayoutLMv2ForSer(NLPBaseModel) if self.training: res = {"backbone_out": x[0]} # res.update(x[1]) 注释掉 return res else: return x # 模型加载 paddlenlp.transformers.model_utils 模型加载的path直接path = './inference/model_state.pdparams' 模型网上提前下载好。 pretrained_resource_files_map =...

我也遇到该问题,请问您怎么解决的。我定位到问题原因。 def infer(self, input_dict: dict): # self.input_names:['src_ids', 'sent_ids', 'pos_ids', '2d_pos_ids', 'segment_ids', 'task_ids', 'input_mask_mat', 'super_rel_pos', 'unique_id', 'image'],这几个字段在input_dict中除了image都是[]空的。 # input_dict的key:['id', 'question_id', 'questions', 'tokens', 'input_ids', 'attention_mask', 'token_type_ids', 'bbox', 'position_ids', 'image', 'token_is_max_context', 'token_to_orig_map', 'src_ids',...

> 您好,麻烦请问pytorch版的ctpn性能如何,结合crnn,识别一张图片大概需要多长时间,有用到GPU还是在CPU上计算的? > 我在用CRNN的时候,发现CPU版的耗时很长,一张身份证图片,crnn得十几秒(32core E5 v3的cpu),不知道是什么原因。 > 您在实际使用的时候,FPS大概能达到多少? > > O(∩_∩)O谢谢 同问,pytorch的ctpn比tf的快吗?不算后面的crnn,ctpn一张图6-10s(CPU,tf)

谢谢 yingyibiao ***@***.***> 于2022年4月2日周六 20:16写道: > 您好,LayoutLM 系列模型我们还没有支持转 ONNX。 > > — > Reply to this email directly, view it on GitHub > , > or unsubscribe > > ....

@jiangjiajun 谢谢。 在加载模型进行保存时报错,请问您知道是什么原因导致的吗? 如下: from paddlenlp.transformers import LayoutXLMTokenizer, LayoutXLMForTokenClassification model = LayoutXLMForTokenClassification.from_pretrained('PP-Layout_v1.0_ser_pretrained/') model.eval() input_ids = paddle.static.InputSpec(shape=[None, 512], dtype='int32', name='input_ids') bbox = paddle.static.InputSpec(shape=[None, 512, 4], dtype='int32', name='bbox') image = paddle.static.InputSpec(shape=[None, 3,...