GithubHelp home page GithubHelp logo

Comments (9)

AIChallenger avatar AIChallenger commented on September 18, 2024

考虑到windows环境下可能出现的问题,代码做了部分修改
将图片名到int的映射从 int(int(hashlib.sha256(img_name).hexdigest(), 16) % sys.maxint) 替换为 self.image2hash[img_name],改用字典,key是图像名,value是对应的int值。

如果还有错,建议修改ptbtokenizer.py的53行 p_tokenizer = subprocess.Popen(cmd, cwd=path_to_jar_dirname, stdout=subprocess.PIPE) 为windows相应的用法。
其中cmd = ['java', '-cp', 'stanford-corenlp-3.4.1.jar', 'edu.stanford.nlp.process.PTBTokenizer', '-preserveLines', '-lowerCase', 'tmpeq6wbU']

from ai_challenger_2017.

WuLC avatar WuLC commented on September 18, 2024

好了,谢谢

还有一个疑问,就是这么改了源码后,在我生成自己的 reference.json (跟给出的demo中的 id_to_words.json结构一样)时,图片名到 id 的映射关系是怎样的?还是 int(int(hashlib.sha256(img_name).hexdigest(), 16) % sys.maxint) 么?

from ai_challenger_2017.

AIChallenger avatar AIChallenger commented on September 18, 2024

@自己做reference.json,很灵活,只要保证你自己的图片名有自己相应的int型id就好,保证一一对应就好。

from ai_challenger_2017.

WuLC avatar WuLC commented on September 18, 2024

明白了,谢谢

from ai_challenger_2017.

AIChallenger avatar AIChallenger commented on September 18, 2024

@WuLC Windows环境跑通了是吧?

from ai_challenger_2017.

WuLC avatar WuLC commented on September 18, 2024

是的,之前我跑自己的 reference.json 时,采用的映射关系也是用这种方式 int(int(hashlib.sha256(img_name).hexdigest(), 16) % sys.maxint),不过能够评分,没有报错。

是不是之前的demo 中 hash 后恰好有冲突?

from ai_challenger_2017.

AIChallenger avatar AIChallenger commented on September 18, 2024

@WuLC 应该是不同系统hashlib的计算结果不一样。

from ai_challenger_2017.

WuLC avatar WuLC commented on September 18, 2024

好,还是要抽空看下源码 >_<,关掉issue了

from ai_challenger_2017.

JinmingZhao avatar JinmingZhao commented on September 18, 2024

@WuLC python run_evaluations_test.py 脚本会报错吗? coco_res = coco.loadRes(json_predictions_file) 这里报错了, 由于id_to_test_words 没有images等关键字, 遇到过这个问题吗?

from ai_challenger_2017.

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.