GithubHelp home page GithubHelp logo

Comments (3)

xmxoxo avatar xmxoxo commented on August 20, 2024

请检查设置的环境变量值是否正确:
$TRAINED_CLASSIFIER
$EXP_NAME

请参考readme.md中的说明,指定对应的环境变量,或者直接写出模型文件的目录名称;

from bert-train2deploy.

neveroma avatar neveroma commented on August 20, 2024

我试了一下改了环境变量,故意输错

E:NER_MODEL, Lodding...:[gra:opt:306]:fail to optimize the graph! /work/dl/pretrained-model/chinese_L-12_H-768_A-12/1/bert_config.json; No such file or directory
FileNotFoundError: [Errno 2] No such file or directory: '/work/dl/BERT-train2deploy/output/certificate1/label2id.pkl'

报的错和前面的不同

from bert-train2deploy.

neveroma avatar neveroma commented on August 20, 2024

找到原因了
由于我需要运行的是ner模式,看了下bert_base/server/graph.py的源码

 # 如果PB文件已经存在则,返回PB文件的路径,否则将模型转化为PB文件,并且返回存储PB文件的路径
        if args.model_pb_dir is None:
            # 获取当前的运行路径
            tmp_file = os.path.join(os.getcwd(), 'predict_optimizer')
            if not os.path.exists(tmp_file):
                os.mkdir(tmp_file)
        else:
            tmp_file = args.model_pb_dir
        pb_file = os.path.join(tmp_file, 'ner_model.pb')
        if os.path.exists(pb_file):
            print('pb_file exits', pb_file)
            return pb_file

NER的PD文件默认名称是 ner_model.pb
把freeze_graph.py

pb_file = os.path.join(tmp_dir, 'classification_model.pb')

改成

pb_file = os.path.join(tmp_dir, 'ner_model.pb')

或者仿造 optimize_class_model 方法 加一个 optimize_ner_model
服务就可以跑起来了

from bert-train2deploy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.