Giter Club home page Giter Club logo

Comments (8)

chuangfortytwo avatar chuangfortytwo commented on May 18, 2024

我在pycharm上输出时加了decode(’utf-8‘)解决了,但是看其它人都没遇到这个问题很奇怪

from nmt.

oahziur avatar oahziur commented on May 18, 2024

For 1, I think it is because the tutorial logs are generated by python2. I will investigate later to make the logging works correctly for both python2 and 3.

For 2, We recently updated the flags. Change model_dir to out_dir should fix the problem. For example


python -m nmt.nmt \
    --out_dir=/tmp/nmt_model \
    --inference_input_file=/tmp/my_infer_file.vi \
    --inference_output_file=/tmp/nmt_model/output_infer

from nmt.

yanl10n avatar yanl10n commented on May 18, 2024

Thank you @chuangfortytwo @oahziur! I would try today and share you the result later.

from nmt.

anglil avatar anglil commented on May 18, 2024

@oahziur @lmthang @yanl10n I tried the vietnamese to english translation in the tutorial and got decoder output all in byte string format, i.e., string with a 'b' in front of it. Is this the expected behavior? Should I manually convert the output strings into utf-8? Thanks!

from nmt.

sdlmw avatar sdlmw commented on May 18, 2024

@chuangfortytwo ,那能不能在输出到文件的时候就给转码了(抱歉,pycharm没有接触过),还有如果加载到一个服务上,是否可以输出转码的内容

from nmt.

chuangfortytwo avatar chuangfortytwo commented on May 18, 2024

@sdlmw 最后计算bleu值的时候就是从文件读取的,可以在输出到文件时转码。服务这个没试过

from nmt.

ljch2018 avatar ljch2018 commented on May 18, 2024

sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')

from nmt.

yanl10n avatar yanl10n commented on May 18, 2024

Thank you All for the supports! Confirmed all issues had been fixed now.

from nmt.

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.