NTMC-Community / MatchZoo

Facilitating the design, comparison and sharing of deep text matching models.
Apache License 2.0
3.82k stars 898 forks source link

ImportError: cannot import name 'losses_utils' #832

Closed saekomdalkom closed 3 years ago

saekomdalkom commented 3 years ago

Hello, I'm trying to use matchzoo in google colab, but after I installed matchzoo with !pip install matchzoo when I try to import it this error is occuring:


ImportError Traceback (most recent call last)

in () 1 get_ipython().system('pip install matchzoo') ----> 2 import matchzoo as mz 3 print(mz.__version__) 2 frames /usr/local/lib/python3.6/dist-packages/matchzoo/losses/rank_cross_entropy_loss.py in () 5 from keras import layers, backend as K 6 from keras.losses import Loss ----> 7 from keras.utils import losses_utils 8 9 ImportError: cannot import name 'losses_utils' Maybe packages' version problem, I guess? Can someone help me? Before importing I didn't do anything in colab, and same code is working well in local python command. local: - matchzoo 2.2.0 - keras 2.3.1 - tensorflow 2.1.0 colab: - matchzoo 2.2.0 - keras 2.4.3 - tensorflow 2.3.0
Chriskuei commented 3 years ago

The version of packages in colab environment is not supported by Matchzoo 2.2.0, please refer to the requirements.txt https://github.com/NTMC-Community/MatchZoo/blob/fe0ccdd82500d116a7f945539ed05566fce90434/requirements.txt#L1-L3

saekomdalkom commented 3 years ago

The version of packages in colab environment is not supported by Matchzoo 2.2.0, please refer to the requirements.txt https://github.com/NTMC-Community/MatchZoo/blob/fe0ccdd82500d116a7f945539ed05566fce90434/requirements.txt#L1-L3

Thank you!