Comments (12)
Hi @lvapeab , i hava installed the Coco-caption package successfully.
__init__.py __init__.pyc ter.py ter.pyc
from nmt-keras.
Hi @lvapeab , it works, thank you very much!
from nmt-keras.
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.
Commenting out the lines works, thanks!
from nmt-keras.
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.
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.
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.
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.
请问你是在中英翻译吗?这个bug你解决了吗?
from nmt-keras.
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.
Hi @qazs ,
do you have java
(version 1.8.0 or newer) installed?
from nmt-keras.
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)
- Support for Factored Models ? HOT 1
- consume long time for predicting validation output HOT 3
- Confusion with opennmt-tf HOT 1
- Missing auto setup of required packages for running this library HOT 1
- How to use pretrained word2vec embeddings? HOT 1
- Getting error index out of range when training a Transformer model HOT 10
- Using CPU for inference with GPU-trained model HOT 20
- Evaluating perplexity HOT 4
- Getting error when using Tensorboard HOT 2
- Save perplexity on training and validation sets HOT 5
- Regd Rare Words/OOV Tokens ? HOT 9
- Sampling decoding HOT 1
- Strange behavior with plotting metrics for validation HOT 2
- Issue with ensemble scoring method HOT 3
- AssertionError: Reduction function "Noam" unimplemented! HOT 1
- Data Error ? HOT 6
- Detecting multiple GPUs HOT 9
- Training Error HOT 1
- Conversion to TFJS HOT 1
- Example Colab Fails HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nmt-keras.