Closed jitesh-rathod closed 3 years ago
i am trying traning model but got error guys can you provided step for traning model i was go throught the step but cant understand i am student so plz provided me sample step for traing
download latest code,we have fixed this
python3 train.py -c configs/rec/rec_icdar15_train.yml 2>&1 | tee train_rec.log 2020-11-25 15:08:02,934-INFO: {'Global': {'debug': False, 'algorithm': 'CRNN', 'use_gpu': False, 'epoch_num': 1000, 'log_smooth_window': 20, 'print_batch_step': 10, 'save_model_dir': './output/rec_CRNN', 'save_epoch_step': 300, 'eval_batch_step': 500, 'train_batch_size_per_card': 256, 'test_batch_size_per_card': 256, 'image_shape': [3, 32, 100], 'max_text_length': 25, 'character_type': 'en', 'loss_type': 'ctc', 'distort': True, 'reader_yml': './configs/rec/rec_icdar15_reader.yml', 'pretrain_weights': './pretrain_models/rec_mv3_none_bilstm_ctc/best_accuracy', 'checkpoints': None, 'save_inference_dir': None, 'infer_img': None}, 'Architecture': {'function': 'ppocr.modeling.architectures.rec_model,RecModel'}, 'Backbone': {'function': 'ppocr.modeling.backbones.rec_mobilenet_v3,MobileNetV3', 'scale': 0.5, 'model_name': 'large'}, 'Head': {'function': 'ppocr.modeling.heads.rec_ctc_head,CTCPredict', 'encoder_type': 'rnn', 'SeqRNN': {'hidden_size': 96}}, 'Loss': {'function': 'ppocr.modeling.losses.rec_ctc_loss,CTCLoss'}, 'Optimizer': {'function': 'ppocr.optimizer,AdamDecay', 'base_lr': 0.0005, 'beta1': 0.9, 'beta2': 0.999, 'decay': {'function': 'cosine_decay', 'step_each_epoch': 20, 'total_epoch': 1000}}, 'TrainReader': {'reader_function': 'ppocr.data.rec.dataset_traversal,SimpleReader', 'num_workers': 8, 'img_set_dir': './train_data/ic15_data', 'label_file_path': './train_data/ic15_data/rec_gt_train.txt'}, 'EvalReader': {'reader_function': 'ppocr.data.rec.dataset_traversal,SimpleReader', 'img_set_dir': './train_data/ic15_data', 'label_file_path': './train_data/ic15_data/rec_gt_test.txt'}, 'TestReader': {'reader_function': 'ppocr.data.rec.dataset_traversal,SimpleReader'}} Traceback (most recent call last): File "train.py", line 131, in
main()
File "train.py", line 51, in main
config, train_program, startup_program, mode='train')
File "/home/jitesh/Desktop/Web Services/PaddleOCR-develop/tools/program.py", line 172, in build
dataloader, outputs = model(mode=mode)
File "/home/jitesh/Desktop/Web Services/PaddleOCR-develop/ppocr/modeling/architectures/rec_model.py", line 201, in call
image, labels, loader = self.create_feed(mode)
File "/home/jitesh/Desktop/Web Services/PaddleOCR-develop/ppocr/modeling/architectures/rec_model.py", line 84, in create_feed
image = fluid.data(name='image', shape=image_shape, dtype='float32')
File "", line 2, in data
File "/home/jitesh/anaconda3/envs/webservice/lib/python3.6/site-packages/paddle/fluid/wrapped_decorator.py", line 25, in impl
return wrapped_func(*args, **kwargs)
File "/home/jitesh/anaconda3/envs/webservice/lib/python3.6/site-packages/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.