Closed xuyuhui666 closed 4 years ago
你使用的是Paddle1.7以上的版本吗?可以提供更加详细的日志信息吗?
版本不是很清楚,就是前天下载的
++++++++ 2020-07-31 20:58:22,520-INFO: places would be ommited when DataLoader is not iterable 2020-07-31 20:59:04,252-INFO: Loading parameters from ./pretrain_models/MobileNetV3_large_x0_5_pretrained/... 2020-07-31 21:22:33,662-WARNING: ./pretrain_models/MobileNetV3_large_x0_5_pretrained/.pdparams not found, try to load model file saved with [ save_params, save_persistables, save_vars ] 2020-07-31 21:22:33,662-WARNING: ./pretrain_models/MobileNetV3_large_x0_5_pretrained/.pdparams not found, try to load model file saved with [ save_params, save_persistables, save_vars ] Traceback (most recent call last): File "C:\ProgramData\Miniconda3\lib\site-packages\paddle\fluid\io.py", line 1865, in load_program_state filename=file_name) File "C:\ProgramData\Miniconda3\lib\site-packages\paddle\fluid\io.py", line 793, in load_vars executor.run(load_prog) File "C:\ProgramData\Miniconda3\lib\site-packages\paddle\fluid\executor.py", line 790, in run six.reraise(*sys.exc_info()) File "C:\ProgramData\Miniconda3\lib\site-packages\six.py", line 693, in reraise raise value File "C:\ProgramData\Miniconda3\lib\site-packages\paddle\fluid\executor.py", line 785, in run use_program_cache=use_program_cache) File "C:\ProgramData\Miniconda3\lib\site-packages\paddle\fluid\executor.py", line 838, in _run_impl use_program_cache=use_program_cache) File "C:\ProgramData\Miniconda3\lib\site-packages\paddle\fluid\executor.py", line 912, in _run_program fetch_var_name) paddle.fluid.core_avx.EnforceNotMet: ++++++++++ 上面是报的错误,加载模型时候在save_load.py文件下load_params(exe, prog, path, ignore_params=[])函数报错了,我看里面有个判断:if not (os.path.isdir(path) or os.path.exists(path + '.pdparams')),不是很清楚为什么path是模型文件夹,为什么要加 '.pdparams'字符串呢?
版本是1.7.2的,应该不是版本的问题
你使用的是Paddle1.7以上的版本吗?可以提供更加详细的日志信息吗? 我用的是paddlepaddle 1.8.3 paddle1.02 日志信息是这样的 `tools/train.py -c configs/rec/rec_mv3_none_bilstm_ctc.yml 2020-07-31 18:16:36,862-INFO: {'Global': {'debug': True, 'algorithm': 'CRNN', 'use_gpu': False, 'epoch_num': 1024, 'log_smooth_window': 20, 'print_batch_step': 128, 'save_model_dir': './output/rec_CRNN', 'save_epoch_step': 256, 'eval_b atch_step': 500, 'train_batch_size_per_card': 256, 'test_batch_size_per_card': 256, 'image_shape': [3, 32, 320], 'max_text_length': 20, 'character_type': 'ch', 'loss_type': 'ctc', 'reader_yml': './configs/rec/rec_benchmark_reader.yml', 'pretrain_weights': './pretrain_models/rec_mv3_none_bilstm_ctc/best_accuracy', 'checkpoints': None, 'save_inference_dir': None, 'infer_img': None, 'character_dict_path': './ppocr/utils/new.txt', 'cpu_num': 8}, 'Architecture': {'functi on': '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,CT CPredict', 'encoder_type': 'rnn', 'SeqRNN': {'hidden_size': 96}}, 'Loss': {'function': 'ppocr.modeling.losses.rec_ctc_loss,CTCLoss'}, 'Optimizer': {'function': 'ppocr.optimizer,AdamDecay', 'base_lr': 0.005, 'beta1': 0.9, 'beta2': 0.999 , 'decay': {'function': 'cosine_decay', 'step_each_epoch': 24, 'total_epoch': 1024}}, 'TrainReader': {'reader_function': 'ppocr.data.rec.dataset_traversal,SimpleReader', 'num_workers': 8, 'img_set_dir': './train_data', 'label_file_path ': './train_data/train_rec_label.txt'}, 'EvalReader': {'reader_function': 'ppocr.data.rec.dataset_traversal,SimpleReader', 'img_set_dir': './train_data', 'label_file_path': './train_data/test_rec_label.txt'}, 'TestReader': {'reader_fun ction': 'ppocr.data.rec.dataset_traversal,SimpleReader'}} 2020-07-31 18:16:37,388-INFO: If regularizer of a Parameter has been set by 'fluid.ParamAttr' or 'fluid.WeightNormParamAttr' already. The Regularization[L2Decay, regularization_coeff=0.000000] in Optimizer will not take effect, and it will only be applied to other Parameters! 2020-07-31 18:16:38,998-INFO: places would be ommited when DataLoader is not iterable Notice: now supported ops include [Conv, DepthwiseConv, FC(mul), BatchNorm, Pool, Activation(sigmoid, tanh, relu, leaky_relu, prelu)] 2020-07-31 18:16:39,245-INFO: Loading parameters from ./pretrain_models/rec_mv3_none_bilstm_ctc/best_accuracy... 2020-07-31 18:16:39,306-WARNING: variable ctc_fc_w_attr not used 2020-07-31 18:16:39,306-WARNING: variable ctc_fc_b_attr not used 2020-07-31 18:16:39,343-INFO: Finish initing model from ./pretrain_models/rec_mv3_none_bilstm_ctc/best_accuracy !!! The CPU_NUM is not specified, you should set CPU_NUM in the environment variable list. CPU_NUM indicates that how many CPUPlace are used in the current task. And if this parameter are set as N (equal to the number of physical CPU core) the program may be faster.
export CPU_NUM=8 # for example, set CPU_NUM as number of physical CPU core which is 8.
!!! The default number of CPU_NUM=1. W0731 18:16:39.384634 11400 build_strategy.cc:170] fusion_group is not enabled for Windows/MacOS now, and only effective when running with CUDA GPU. multiprocess is not fully compatible with Windows.num_workers will be 1. does not exist!:40,307-INFO: ./train_data/`
这个看着是加载成功了的
版本不是很清楚,就是前天下载的
++++++++ 2020-07-31 20:58:22,520-INFO: places would be ommited when DataLoader is not iterable 2020-07-31 20:59:04,252-INFO: Loading parameters from ./pretrain_models/MobileNetV3_large_x0_5_pretrained/... 2020-07-31 21:22:33,662-WARNING: ./pretrain_models/MobileNetV3_large_x0_5_pretrained/.pdparams not found, try to load model file saved with [ save_params, save_persistables, save_vars ] 2020-07-31 21:22:33,662-WARNING: ./pretrain_models/MobileNetV3_large_x0_5_pretrained/.pdparams not found, try to load model file saved with [ save_params, save_persistables, save_vars ] Traceback (most recent call last): File "C:\ProgramData\Miniconda3\lib\site-packages\paddle\fluid\io.py", line 1865, in load_program_state filename=file_name) File "C:\ProgramData\Miniconda3\lib\site-packages\paddle\fluid\io.py", line 793, in load_vars executor.run(load_prog) File "C:\ProgramData\Miniconda3\lib\site-packages\paddle\fluid\executor.py", line 790, in run six.reraise(*sys.exc_info()) File "C:\ProgramData\Miniconda3\lib\site-packages\six.py", line 693, in reraise raise value File "C:\ProgramData\Miniconda3\lib\site-packages\paddle\fluid\executor.py", line 785, in run use_program_cache=use_program_cache) File "C:\ProgramData\Miniconda3\lib\site-packages\paddle\fluid\executor.py", line 838, in _run_impl use_program_cache=use_program_cache) File "C:\ProgramData\Miniconda3\lib\site-packages\paddle\fluid\executor.py", line 912, in _run_program fetch_var_name) paddle.fluid.core_avx.EnforceNotMet: ++++++++++ 上面是报的错误,加载模型时候在save_load.py文件下load_params(exe, prog, path, ignore_params=[])函数报错了,我看里面有个判断:if not (os.path.isdir(path) or os.path.exists(path + '.pdparams')),不是很清楚为什么path是模型文件夹,为什么要加 '.pdparams'字符串呢?
因为在Paddle1.7以前,模型文件是按照零散文件来存储的,在1.7之后统一了save load接口,都会保存为pdparams文件,所以在这里pretrain只需提供预训练前缀(新版预训练模型)或者文件夹(零散文件形式的预训练模型)即可。
Windows not support stack backtrace yet.
File "C:\ProgramData\Miniconda3\lib\site-packages\paddle\fluid\framework.py", line 2525, in append_op
attrs=kwargs.get("attrs", None))
File "C:\ProgramData\Miniconda3\lib\site-packages\paddle\fluid\reader.py", line 733, in _init_non_iterable
outputs={'Out': self._feed_list})
File "C:\ProgramData\Miniconda3\lib\site-packages\paddle\fluid\reader.py", line 646, in init
self._init_non_iterable()
File "C:\ProgramData\Miniconda3\lib\site-packages\paddle\fluid\reader.py", line 280, in from_generator
iterable, return_list)
File "E:\xuyuhui\PaddleOCR\ppocr\modeling\architectures\det_model.py", line 104, in create_feed
iterable=False)
File "E:\xuyuhui\PaddleOCR\ppocr\modeling\architectures\det_model.py", line 117, in call
image, labels, loader = self.create_feed(mode)
File "E:\xuyuhui\PaddleOCR\tools\program.py", line 175, in build
dataloader, outputs = model(mode=mode)
File "E:/xuyuhui/PaddleOCR/tools/train.py", line 50, in main
config, train_program, startup_program, mode='train')
File "E:/xuyuhui/PaddleOCR/tools/train.py", line 121, in
Error: Blocking queue is killed because the data reader raises an exception [Hint: Expected killed != true, but received killed:1 == true:1.] at (D:\1.7.2\paddle\paddle/fluid/operators/reader/blocking_queue.h:141) [operator < read > error] W0801 14:32:19.696929 277288 device_context.cc:237] Please NOTE: device: 0, CUDA Capability: 61, Driver API Version: 10.1, Runtime API Version: 10.0 W0801 14:32:19.704908 277288 device_context.cc:245] device: 0, cuDNN Version: 7.4. I0801 14:32:22.009755 277288 parallel_executor.cc:440] The Program will be executed on CUDA using ParallelExecutor, 1 cards are used, so 1 programs are executed in parallel. I0801 14:32:22.069594 277288 build_strategy.cc:365] SeqOnlyAllReduceOps:0, num_trainers:1 I0801 14:32:22.231163 277288 parallel_executor.cc:307] Inplace strategy is enabled, when build_strategy.enable_inplace = True I0801 14:32:22.269088 277288 parallel_executor.cc:375] Garbage collection strategy is enabled, when FLAGS_eager_delete_tensor_gb = 0 +++++++++ 不知道是哪出问题了?
可以看下数据路径中的图片文件是否存在
好的,谢谢了,换了解压文件方式后能加载模型了
好的~
好的,谢谢了,换了解压文件方式后能加载模型了
可以详细说说怎么解决的么? 我这边解压出来预训练模型是很多个文件。也是没有.pdparams文件
加载模型时候报以下错误: ./pretrain_models/MobileNetV3_large_x0_5_pretrained/.pdparams not found,
这一看路径就错了嘛! 要写成:./pretrain_models/MobileNetV3_large_x0_5_pretrained/best_accuracy
加载模型时候报以下错误: ./pretrain_models/MobileNetV3_large_x0_5_pretrained/.pdparams not found, 模型已经放在这个目录下了,配置文件det_mv3_db.yml里面也已经设置好模型路径了,不知道是哪地方设置错了