TuneSearchCV import fail

Here is the error when I try to import

>>> from tune_sklearn import TuneSearchCV
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/tmamidi/.conda/envs/training/lib/python3.8/site-packages/tune_sklearn/__init__.py", line 1, in <module>
    from tune_sklearn.tune_gridsearch import TuneGridSearchCV
  File "/home/tmamidi/.conda/envs/training/lib/python3.8/site-packages/tune_sklearn/tune_gridsearch.py", line 9, in <module>
    from sklearn.model_selection import ParameterGrid
  File "/home/tmamidi/.conda/envs/training/lib/python3.8/site-packages/sklearn/model_selection/__init__.py", line 21, in <module>
    from ._validation import cross_val_score
  File "/home/tmamidi/.conda/envs/training/lib/python3.8/site-packages/sklearn/model_selection/_validation.py", line 30, in <module>
    from ..metrics import check_scoring
  File "/home/tmamidi/.conda/envs/training/lib/python3.8/site-packages/sklearn/metrics/__init__.py", line 7, in <module>
    from ._ranking import auc
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 779, in exec_module
  File "<frozen importlib._bootstrap_external>", line 911, in get_code
  File "<frozen importlib._bootstrap_external>", line 580, in _compile_bytecode
EOFError: marshal data too short

I’m using python-3.8.5 and ray-1.3.0 along with tune-sklearn.

Any help is appreciated!
Thanks!

Can you please try import sklearn?

import sklearn works!
I’m still getting the same error for TuneSearchCV.

This is my conda environment, if it helps debugging

name: training

channels:
  - conda-forge
  - anaconda

dependencies:
  - python=3.8.5
  - pandas=1.2.1
  - numpy=1.18.5
  - optuna=2.5.0
  - scikit-learn=0.24.1
  - imbalanced-learn=0.7.0
  - scipy=1.4.1
  - shap=0.37.0
  - pip
  - gpy=1.9.9
  #- cudatoolkit=11.0.221
  - pip:
    - ray==1.3.0
    - ray[tune]
    - tune-sklearn
    #- hyperopt==0.2.5
    - tensorflow-gpu==2.3
    - lz4==3.1.3
    - scikit-optimize==0.8.1

Can you now try:

from sklearn.model_selection import ParameterGrid

because that seems to be the issue?

I’ve deleted the conda environment and rebuilt it. Both of them seems to be loading fine. I’ll run the tuning script and let you know if I still see something.
Thanks for the help!