python2.7训练模型lac.train报错
- Dominant language
- C++
- Stars
- 4k
- Forks
- 592
- PR merge metrics
- No merged PRs in 30d
Description
`W1029 13:25:53.342841 17028 analysis_predictor.cc:1042] Deprecated. Please use CreatePredictor instead.
Traceback (most recent call last):
File "/home/baron/git/project-pac-nlp/prj/01-website/prj-02-11-tools-for-baiduai/LAC/test_01_cut.py", line 49, in
train_cut()
File "/home/baron/git/project-pac-nlp/prj/01-website/prj-02-11-tools-for-baiduai/LAC/test_01_cut.py", line 21, in train_cut
lac.train(model_save_dir='./my_seg_model/',train_data=train_file, test_data=test_file)
File "/usr/local/lib/python2.7/dist-packages/LAC-2.0.5-py2.7.egg/LAC/lac.py", line 164, in train
test_program, fetch_list = nets.do_train(self.args)
File "/usr/local/lib/python2.7/dist-packages/LAC-2.0.5-py2.7.egg/LAC/nets.py", line 306, in do_train
args, dataset.vocab_size, dataset.num_labels, mode='train')
File "/usr/local/lib/python2.7/dist-packages/LAC-2.0.5-py2.7.egg/LAC/nets.py", line 158, in create_model
name='words', shape=[-1, 1], dtype='int64', lod_level=1)
File "", line 2, in data
File "/usr/local/lib/python2.7/dist-packages/paddlepaddle-2.0.0rc0-py2.7-linux-x86_64.egg/paddle/fluid/wrapped_decorator.py", line 25, in __impl__
return wrapped_func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/paddlepaddle-2.0.0rc0-py2.7-linux-x86_64.egg/paddle/fluid/framework.py", line 232, in __impl__
), "We only support '%s()' in static graph mode, please call 'paddle.enable_static()' to enter static graph mode." % func.__name__
AssertionError: We only support 'data()' in static graph mode, please call 'paddle.enable_static()' to enter static graph mode.`
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the failure with LAC/test_01_cut.py, especially train_cut() and its call to lac.train(). Then inspect LAC/lac.py and LAC/nets.py around the reported training and model-creation lines, along with the recorded Python and PaddlePaddle versions. Done means establishing a supported way for this training path to run without the static-graph assertion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100