Comments (18)
Thanks a lot @ricardorei . It works perfectly!
from comet.
It still doesn't work for Python 3.8...
from comet.
Yes, it works (with a few command-line parameter changes). Thank you!
from comet.
@AnanyaCoder
the same error occours in my python3.7 env, have you figured it out?
from comet.
Is there any plan to make it work for python 3.8?
Yes, I already tested it before in python 3.8 and 3.9. It should support python 3.6, 3.7, 3.8, and 3.9. I'll take a look at it tomorrow. It is probably just a reqs/dependency problem...
from comet.
Btw does the command: comet-score -s src.de -t hyp.en -r ref.en
work?
from comet.
Hi, I had the same issue. I switched to Python 3.7 and pandas==1.1.5 to make it work for me. (Installed from pip & running locally- no GPU)
from comet.
Btw does the command:
comet-score -s src.de -t hyp.en -r ref.en
work?
It does not work either. I get:
File "/usr/local/Cellar/[email protected]/3.8.12/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'CometModel.predict.<locals>.<lambda>'
from comet.
@joncamgui I got the same error but using 3.7 and pandas==1.1.5 resolved it.
from comet.
I found the error.
I believe during Inference Pytorch Lightning will create model copies and it will complain about the fact that there is a lambda function defines locally: https://github.com/Unbabel/COMET/blob/master/comet/models/base.py#L445
After fixing that error it will complain about the local definition of PredictProgressBar.
I am just wondering why it works for some python versions and not for others.
from comet.
I also have an issue with Python 3.8:
$ python3 -V
3.8.10
$ pip list | grep comet
unbabel-comet 0.1.0
$ comet score --model wmt-large-da-estimator-1719 [...]
Traceback (most recent call last):
File "/usr/local/bin/comet", line 8, in <module>
sys.exit(comet())
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/comet/cli.py", line 133, in score
model = load_checkpoint(model) if os.path.exists(model) else download_model(model)
File "/usr/local/lib/python3.8/dist-packages/comet/models/__init__.py", line 98, in download_model
return load_checkpoint(checkpoint_path)
File "/usr/local/lib/python3.8/dist-packages/comet/models/__init__.py", line 131, in load_checkpoint
model = str2model[hparams["model"]].load_from_checkpoint(
File "/usr/local/lib/python3.8/dist-packages/pytorch_lightning/core/saving.py", line 157, in load_from_checkpoint
model = cls._load_model_state(checkpoint, strict=strict, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/pytorch_lightning/core/saving.py", line 199, in _load_model_state
model = cls(**_cls_kwargs)
File "/usr/local/lib/python3.8/dist-packages/comet/models/estimators/comet_estimator.py", line 35, in __init__
super().__init__(hparams)
File "/usr/local/lib/python3.8/dist-packages/comet/models/estimators/estimator_base.py", line 70, in __init__
super().__init__(hparams)
File "/usr/local/lib/python3.8/dist-packages/comet/models/model_base.py", line 134, in __init__
self.hparams = Namespace(**hparams)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 819, in __setattr__
object.__setattr__(self, name, value)
AttributeError: can't set attribute
from comet.
Hi @mjpost can you test it using the pre-release version?
pip install unbabel-comet==1.0.0rc8
I fixed some of the problems reported on this thread already.
from comet.
@joncamgui please test it now: pip install unbabel-comet==1.0.0rc8
I fixed the error you reported already
from comet.
Hi @ricardorei
Any plan to make the official 1.0 available in standard 3.8 pip:
pip3.8 install unbabel-comet==1.0.0
ERROR: Could not find a version that satisfies the requirement unbabel-comet==1.0.0 (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.6, 0.0.6.post1, 0.0.6.post2, 0.0.7, 0.1.0, 1.0.0rc1, 1.0.0rc2, 1.0.0rc3, 1.0.0rc4, 1.0.0rc5, 1.0.0rc6, 1.0.0rc7, 1.0.0rc8, 1.0.0rc9)
ERROR: No matching distribution found for unbabel-comet==1.0.0
Best
W.
from comet.
@WilliamTambellini I release version 1.0 a few hours ago and I tested it on python 3.8. As you can see your pip should return you 1.0.0 and 1.0.1 versions
The install test for python 3.8 can be seen here.
from comet.
have you tried to upgrade pip?
from comet.
I am reopening this until its fixed.
from comet.
ImportError Traceback (most recent call last)
/tmp/ipykernel_33/376669550.py in
----> 1 from comet import download_model, load_from_checkpoint
2 import os
3 import sys
4 #from comet.models import download_model
5 #Load COMET Models before hand
ImportError: cannot import name 'download_model' from 'comet' (/opt/conda/lib/python3.7/site-packages/comet/init.py)
from comet.
Related Issues (20)
- Multi-gpu inference returns AttributeError HOT 7
- Mismatch between error span and offsets HOT 2
- [QUESTION] Reliability for en-th and th-en pair HOT 2
- AttributeError: 'dict' object has no attribute 'scores' HOT 2
- [QUESTION] AttributeError: An error occurred during model prediction: 'dict' object has no attribute 'scores' HOT 5
- AttributeError: 'dict' object has no attribute 'scores' when using the model 'Unbabel/wmt22-cometkiwi-da' HOT 4
- When loading huggingface Unbabel/wmt22-cometkiwi-da checkpoint, UnpicklingError
- [QUESTION] Unable to use ReLU as activation function HOT 4
- [QUESTION] Keep getting scores of '0' no matter what input used HOT 5
- HF Hub dependency conflicts with latest `tranformers` version. HOT 3
- if tgt is same with src, the score is still high HOT 2
- [QUESTION] Train UnifiedMetric/XCOMET with word level predictions. HOT 1
- Sparsemax not actually used in COMET-KIWI, XCOMET-XL/XXL HOT 4
- Invalid link reference of reference-free model in readme
- Minimizing cpu RAM vs only use GPU RAM HOT 1
- what is the precision when load_from_checkpoint?
- Runtime error when loading wmt23-cometkiwi-da-xl HOT 1
- Different scores from different COMET package versions 1.1.2 and 2.2.1 HOT 2
- Different versions of COMET code give different scores with the same model and date.
- [QUESTION] large file scoring HOT 3
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 comet.