Closed 22826165 closed 4 years ago
是在docker中操作的吗,执行hub install chinese_ocr_db_crnn_mobile==1.1.0试试呢?
我重新装了下,修改了ocr_system params.py参数,目前hub ocr_system启动正常啦。但用test_hubserving.py测试报错: λ yy-virtual-machine /mnt/PaddleOCR {develop} hub serving start -c deploy/hubserving/ocr_system/config.json grep: warning: GREP_OPTIONS is deprecated; please use an alias or script ocr_system == 1.0.0
Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/paddlehub/serving/app_single.py", line 42, in predict_v2_advanced output = serving_method(*predict_args) File "/usr/local/lib/python3.7/site-packages/paddlehub/module/module.py", line 72, in _wrapper return func(args, kwargs) File "/root/.paddlehub/modules/ocr_system/module.py", line 123, in serving_method results = self.predict(images_decode, kwargs) File "/root/.paddlehub/modules/ocr_system/module.py", line 98, in predict dt_boxes, rec_res = self.text_sys(img) File "/mnt/PaddleOCR/tools/infer/predict_system.py", line 88, in call dt_boxes, elapse = self.text_detector(img) File "/mnt/PaddleOCR/tools/infer/predict_det.py", line 142, in call if self.use_zero_copy_run: AttributeError: 'TextDetector' object has no attribute 'use_zero_copy_run' 2020-09-24 05:27:58,106-INFO: 127.0.0.1 - - [24/Sep/2020 05:27:58] "POST /predict/ocr_system HTTP/1.1" 200 -
缺少参数“ use_zero_copy_run”,你的代码版本应该不是最新的,可以手动把这个参数加上,在params.py里:https://github.com/PaddlePaddle/PaddleOCR/blob/8750361a5d73790ac2580f6dcda76653262af568/deploy/hubserving/ocr_system/params.py#L49
请问哪里下载最新代码,我是git clone的,我加上试试看
from future import absolute_import from future import division from future import print_function
class Config(object): pass
def read_params(): cfg = Config()
#params for text detector
cfg.det_algorithm = "DB"
cfg.det_model_dir = "./inference/ch_ppocr_mobile_v1.1_det_infer/"
cfg.det_max_side_len = 960
#DB parmas
cfg.det_db_thresh =0.3
cfg.det_db_box_thresh =0.5
cfg.det_db_unclip_ratio =2.0
#EAST parmas
cfg.det_east_score_thresh = 0.8
cfg.det_east_cover_thresh = 0.1
cfg.det_east_nms_thresh = 0.2
#params for text recognizer
cfg.rec_algorithm = "CRNN"
cfg.rec_model_dir = "./inference/ch_ppocr_mobile_v1.1_rec_infer/"
cfg.rec_image_shape = "3, 32, 320"
cfg.rec_char_type = 'ch'
cfg.rec_batch_num = 30
cfg.max_text_length = 25
cfg.rec_char_dict_path = "./ppocr/utils/ppocr_keys_v1.txt"
cfg.use_space_char = True
#params for text classifier
cfg.use_angle_cls = True
cfg.cls_model_dir = "./inference/ch_ppocr_mobile_v1.1_cls_infer/"
cfg.cls_image_shape = "3, 48, 192"
cfg.label_list = ['0', '180']
cfg.cls_batch_num = 30
cfg.cls_thresh = 0.9
cfg.use_zero_copy_run = False
cfg.use_pdserving = False
return cfg
加上了,还是AttributeError: 'TextDetector' object has no attribute 'use_zero_copy_run'
那还是拉一下最新的代码吧,git clone,最近代码更新比较频繁
我刚测试了新代码应该是没问题的
大哥,我也是发问题的时候才更新的。。ch_ppocr_mobile_v1.1_cls_infer/ ch_ppocr_mobile_v1.1_det_infer/ ch_ppocr_mobile_v1.1_rec_infer/ 是不是模型不对呀?
搞定了,还是得全部重来。。。。感谢大神
大哥,我也是发问题的时候才更新的。。 哈哈,楼上明明是位人美心善代码6的小姐姐:)
我今天也遇到了这个问题,打算换个模型,然后安装报错。所以 这个问题的解决办法是完全重装?我重新clone了代码 还是报一样的错误 cfg.use_zero_copy_run = False 这个配置文件里有设置
第一次安装后会生成配置文件,如果不手动删除,第二次安装时就会报这个错
第一次安装后会生成配置文件,如果不手动删除,第二次安装时就会报这个错
您好,请问这个配置文件在哪里呀?我目前也遇到这个问题了。
第一次安装后会生成配置文件,如果不手动删除,第二次安装时就会报这个错
您好,请问这个配置文件在哪里呀?我目前也遇到这个问题了。
同上
第一次安装后会生成配置文件,如果不手动删除,第二次安装时就会报这个错
您好,请问这个配置文件在哪里呀?我目前也遇到这个问题了。
同上
Windows的话在你当前用户下,有个.paddlehub目录下,把安装的东西删除就行。 Linux的话好像是在root下也是.paddlehub目录下。
第一次安装后会生成配置文件,如果不手动删除,第二次安装时就会报这个错
您好,请问这个配置文件在哪里呀?我目前也遇到这个问题了。
同上
Windows的话在你当前用户下,有个.paddlehub目录下,把安装的东西删除就行 。Linux的话好像是在根下也是.paddlehub目录下。
多谢,问题已经解决,windows下是将.paddlehub文件夹下的model文件中的ocr_system删除即可
pip install paddlehub/paddlepaddle 安装成功 λ yy-virtual-machine /mnt/PaddleOCR {develop} hub install deploy/hubserving/ocr_system/ grep: warning: GREP_OPTIONS is deprecated; please use an alias or script Traceback (most recent call last): File "/usr/local/python3.5.1/bin/hub", line 8, in
sys.exit(main())
File "/usr/local/python3.5.1/lib/python3.5/site-packages/paddlehub/commands/hub.py", line 64, in main
command.execute(argv[1:])
File "/usr/local/python3.5.1/lib/python3.5/site-packages/paddlehub/commands/hub.py", line 51, in execute
return command.execute(argv[1:])
File "/usr/local/python3.5.1/lib/python3.5/site-packages/paddlehub/commands/install.py", line 54, in execute
module_dir=argv[0], extra=extra)
File "/usr/local/python3.5.1/lib/python3.5/site-packages/paddlehub/module/manager.py", line 199, in install_module
self.all_modules(update=False)
File "/usr/local/python3.5.1/lib/python3.5/site-packages/paddlehub/module/manager.py", line 105, in all_modules
valid, info = self.check_module_valid(sub_dir_path)
File "/usr/local/python3.5.1/lib/python3.5/site-packages/paddlehub/module/manager.py", line 84, in check_module_valid
return True, {'version': version, 'name': _item._name}
UnboundLocalError: local variable 'version' referenced before assignment