COMET: COMET not working with python 3.8
π Bug
COMET works with python 3.6 but not with python 3.8
Environment
OS: MacOS Packaging: pip Version 1.0.0rc6
To Reproduce
I pip installed comet on my python 3.8.12 virtual environment and then tested the example provided in the readme Scoring with Python
seg_scores, sys_score = model.predict(data, batch_size=8, gpus=0)
But I get the following error:
/usr/local/Cellar/python@3.8/3.8.12/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_spawn_posix.py in _launch(self, process_obj)
45 try:
46 reduction.dump(prep_data, fp)
---> 47 reduction.dump(process_obj, fp)
48 finally:
49 set_spawning_popen(None)
/usr/local/Cellar/python@3.8/3.8.12/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/reduction.py in dump(obj, file, protocol)
58 def dump(obj, file, protocol=None):
59 '''Replacement for pickle.dump() using ForkingPickler.'''
---> 60 ForkingPickler(file, protocol).dump(obj)
61
62 #
AttributeError: Can't pickle local object 'CometModel.predict.<locals>.<lambda>'
I tested the same code on python 3.6 and it did work, so thanks a lot π
I expected comet to work with >=python3.5 Is there any plan to make it work for python 3.8?
Thanks again.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (2 by maintainers)
Commits related to this issue
- removed locally defined functions/classes (#26 #27) — committed to Unbabel/COMET by ricardorei 3 years ago
It still doesnβt work for Python 3.8β¦
Thanks a lot @ricardorei . It works perfectly!
@AnanyaCoder the same error occours in my python3.7 env, have you figured it out?
Yes, it works (with a few command-line parameter changes). Thank you!