Giter Club home page Giter Club logo

Comments (12)

hanyaqian avatar hanyaqian commented on May 9, 2024 1

Hi @lvapeab , i hava installed the Coco-caption package successfully.
__init__.py __init__.pyc ter.py ter.pyc

from nmt-keras.

hanyaqian avatar hanyaqian commented on May 9, 2024 1

Hi @lvapeab , it works, thank you very much!

from nmt-keras.

lvapeab avatar lvapeab commented on May 9, 2024 1

Hmm... It seems this error has also been reported in the original scoring library (tylin/coco-caption#28). Unfortunately, I cannot test it in Windows.

As a workaround, I suggest you to edit your keras_wrapper\extra\evaluation.py file (in your case, located in d:\docker\ai\nmt-keras\src\keras-wrapper\keras_wrapper\extra\evaluation.py) and comment the lines which call METEOR 56-57:

# if extra_vars.get('language', 'en') in accepted_langs:
# scorers.append((Meteor(language=extra_vars['language']), "METEOR"))

Moreover, if there is a problem with subprocess and Windows, it is possible that the TER score won't also work. If this is the case, comment the corresponding line (in the same file):

 # (Ter(), "TER"),

from nmt-keras.

qazs avatar qazs commented on May 9, 2024 1

Commenting out the lines works, thanks!

from nmt-keras.

lvapeab avatar lvapeab commented on May 9, 2024

Hello,
thanks for your interest.

It seems that you don't have the jar file that computes the TER metric. Have you installed the Coco-caption package from my fork?

If so, please, can you attach the output of:

ls /home/hanyaqian/anaconda2/lib/python2.7/site-packages/Coco_Caption-0.0-py2.7.egg/pycocoevalcap/ter/

Regards

from nmt-keras.

lvapeab avatar lvapeab commented on May 9, 2024

You lack the tercom file. I don't know if there was a problem in the installation.

You can try reinstalling it again or manually placing the tercom.7.25 file in your /home/hanyaqian/anaconda2/lib/python2.7/site-packages/Coco_Caption-0.0-py2.7.egg/pycocoevalcap/ter/ folder.

from nmt-keras.

hanyaqian avatar hanyaqian commented on May 9, 2024

I reinstalling Coco-caption by the command of python setup.py install, and still lack the tercom file, then manually placing the tercom.7.25 file in the above folder.
And happen another error:
[25/05/2017 17:05:48] Evaluating on metric coco Traceback (most recent call last): File "main.py", line 373, in <module> train_model(parameters, args.dataset) File "main.py", line 133, in train_model nmt_model.trainNet(dataset, training_params) File "build/bdist.linux-x86_64/egg/keras_wrapper/cnn_model.py", line 702, in trainNet File "build/bdist.linux-x86_64/egg/keras_wrapper/cnn_model.py", line 864, in __train File "/home/hanyaqian/anaconda2/lib/python2.7/site-packages/Keras-1.2.0-py2.7.egg/keras/engine/training.py", line 1623, in fit_generator callbacks.on_epoch_end(epoch, epoch_logs) File "/home/hanyaqian/anaconda2/lib/python2.7/site-packages/Keras-1.2.0-py2.7.egg/keras/callbacks.py", line 43, in on_epoch_end callback.on_epoch_end(epoch, logs) File "build/bdist.linux-x86_64/egg/keras_wrapper/extra/callbacks.py", line 185, in on_epoch_end File "build/bdist.linux-x86_64/egg/keras_wrapper/extra/callbacks.py", line 320, in evaluate File "build/bdist.linux-x86_64/egg/keras_wrapper/extra/evaluation.py", line 69, in get_coco_score File "/home/hanyaqian/anaconda2/lib/python2.7/site-packages/Coco_Caption-0.0-py2.7.egg/pycocoevalcap/meteor/meteor.py", line 35, in compute_score score_line, stat = self._stat(res[i][0], gts[i]) File "/home/hanyaqian/anaconda2/lib/python2.7/site-packages/Coco_Caption-0.0-py2.7.egg/pycocoevalcap/meteor/meteor.py", line 54, in _stat self.meteor_p.stdin.write('{}\n'.format(score_line)) IOError: [Errno 32] Broken pipe

under the folder of /home/hanyaqian/anaconda2/lib/python2.7/site-packages/Coco_Caption-0.0-py2.7.egg/pycocoevalcap/meteor is __init__.py __init__.pyc meteor-1.5.jar meteor.py meteor.pyc

the meteor-1.5.jar is also lacked while installed the Coco-caption.

from nmt-keras.

lvapeab avatar lvapeab commented on May 9, 2024

Ok, I've seen the mistake and corrected it in the Coco-caption package (lvapeab/coco-caption@ca089be).

Pull the coco-caption package an run again the
python setup.py install

from nmt-keras.

yanmengqi avatar yanmengqi commented on May 9, 2024

请问你是在中英翻译吗?这个bug你解决了吗?

from nmt-keras.

qazs avatar qazs commented on May 9, 2024

Hi @lvapeab I'm still getting the error, is it because I'm using windows?

Traceback (most recent call last):
  File "main.py", line 445, in <module>
    train_model(parameters, args.dataset)
  File "main.py", line 169, in train_model
    nmt_model.trainNet(dataset, training_params)
  File "d:\docker\ai\nmt-keras\src\keras-wrapper\keras_wrapper\cnn_model.py", line 832, in trainNet
    self.__train(ds, params)
  File "d:\docker\ai\nmt-keras\src\keras-wrapper\keras_wrapper\cnn_model.py", line 1107, in __train
    initial_epoch=params['epoch_offset'])
  File "d:\docker\ai\nmt-keras\src\keras\keras\legacy\interfaces.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "d:\docker\ai\nmt-keras\src\keras\keras\engine\training.py", line 1485, in fit_generator
    initial_epoch=initial_epoch)
  File "d:\docker\ai\nmt-keras\src\keras\keras\engine\training_generator.py", line 247, in fit_generator
    callbacks.on_epoch_end(epoch, epoch_logs)
  File "d:\docker\ai\nmt-keras\src\keras\keras\callbacks.py", line 77, in on_epoch_end
    callback.on_epoch_end(epoch, logs)
  File "d:\docker\ai\nmt-keras\src\keras-wrapper\keras_wrapper\extra\callbacks.py", line 277, in on_epoch_end
    self.evaluate(epoch, counter_name='epoch')
  File "d:\docker\ai\nmt-keras\src\keras-wrapper\keras_wrapper\extra\callbacks.py", line 486, in evaluate
    split=s)
  File "d:\docker\ai\nmt-keras\src\keras-wrapper\keras_wrapper\extra\evaluation.py", line 60, in get_coco_score
    score, _ = scorer.compute_score(refs, hypo)
  File "d:\docker\ai\nmt-keras\src\coco-caption\pycocoevalcap\meteor\meteor.py", line 40, in compute_score
    stat = self._stat(res[i][0], gts[i])
  File "d:\docker\ai\nmt-keras\src\coco-caption\pycocoevalcap\meteor\meteor.py", line 69, in _stat
    self.meteor_p.stdin.flush()
OSError: [Errno 22] Invalid argument

from nmt-keras.

lvapeab avatar lvapeab commented on May 9, 2024

Hi @qazs ,

do you have java (version 1.8.0 or newer) installed?

from nmt-keras.

qazs avatar qazs commented on May 9, 2024

Yes, here's my java version

$ java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) Client VM (build 25.144-b01, mixed mode)
(nmt-keras)

from nmt-keras.

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.