Closed Masterkmp closed 3 years ago
你好!根据上述代码和报错信息,上述组网使用了dynamic_lstm
和sequence_pool
api,这个api 要求输入input
是一个LodTensor, 可以调试看看相应api的类型,看看lod_level
。
Since you haven't replied for more than 3 months, we have closed this issue/pr. If the problem is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up. 由于您超过三个月未回复,我们将关闭这个issue/pr。 若问题未解决或有后续问题,请随时重新打开,我们会继续跟进。
意自定义网络实现bilstm+attention机制实现文本分类,官网中只有视频的lstm+attention(PaddleHub-release-v1.8\PaddleHub-release-v1.8\hub_module\modules\video\classification\videotag_tsn_lstm\resource\models\attention_lstm\lstm_attention.py),参考后报错。。请问哪里写错了? 代码如下: 运行报错: ` 忽略上面的的提示,这里已经对组网方式修改了,使用的并不是默认的bilstm!!!! upad_feature.shape= (-1, 1024) lstm_concat.shape== (-1, 128) lstm_weight.shape== (-1, 1) scaled.shape== (-1, 128)
---------------------------------------------------------------------------EnforceNotMet Traceback (most recent call last) in
1 #开始Finetune
2 print("忽略上面的的提示,这里已经对组网方式修改了,使用的并不是默认的bilstm!!!!")
----> 3 run_states = cls_task.finetune_and_eval()
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddlehub/finetune/task/base_task.py in finetune_and_eval(self)
943
944 def finetune_and_eval(self):
--> 945 return self.finetune(do_eval=True)
946
947 def finetune(self, do_eval=False):
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddlehub/finetune/task/base_task.py in finetune(self, do_eval)
958 # Start to finetune
959 with self.phase_guard(phase="train"):
--> 960 self.init_if_necessary()
961 self._finetune_start_event()
962 run_states = []
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddlehub/finetune/task/base_task.py in init_if_necessary(self)
382 def init_if_necessary(self):
383 if not self.is_checkpoint_loaded:
--> 384 if not self.load_checkpoint():
385 self.exe.run(self._base_startup_program)
386 self.is_checkpoint_loaded = True
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddlehub/finetune/task/base_task.py in load_checkpoint(self)
909 self.config.checkpoint_dir,
910 self.exe,
--> 911 main_program=self.main_program)
912 # Revise max_train_steps when incremental training
913 if is_load_successful:
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddlehub/finetune/task/base_task.py in main_program(self)
543 def main_program(self):
544 if not self.env.is_inititalized:
--> 545 self._build_env()
546 return self.env.main_program
547
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddlehub/finetune/task/base_task.py in _build_env(self)
417 self._base_startup_program):
418 with fluid.unique_name.guard(self.env.UNG):
--> 419 self.env.outputs = self._build_net()
420 if self.is_train_phase or self.is_test_phase:
421 self.env.labels = self._add_label()