sktime / sktime-dl

DEPRECATED, now in sktime - companion package for deep learning based on TensorFlow
BSD 3-Clause "New" or "Revised" License
595 stars 79 forks source link

[BUG] Can't import the CNNClassifier from sktime_dl.deeplearning #119

Closed Antepenultieme closed 9 months ago

Antepenultieme commented 3 years ago

Describe the bug

Hello,

When i try to import the sktime_dl module in my code like you did it in your example, more precisely the CNNClassifier it tell me that the module "sktime_dl.deeplearning" doesn't exist. However i installed sktime-dl before, with "pip install sktime-dl".

To Reproduce

from sktime_dl.deeplearning import CNNClassifier

Versions

Linux-5.4.104+-x86_64-with-Ubuntu-18.04-bionic Python 3.7.11 (default, Jul 3 2021, 18:01:19) [GCC 7.5.0] NumPy 1.19.5 SciPy 1.4.1 sktime 0.7.0 sktime_dl 0.1.0
EricLina commented 3 years ago

I meeted the same BUG too!

loc-trinh commented 3 years ago

examples seem outdated. you guys should get the latest version 0.2.0? of this package and check out the sktime_dl/tests for examples of how to run the various classification models.

nilesh05apr commented 2 years ago

The updated syntax is "from sktime_dl.classification import CNNClassifier"

yerbby commented 2 years ago

Hi,

I think this is broken again.

  1. I installed: Successfully installed deprecated-1.2.13 sktime-0.13.2 sktime-dl-0.1.0

  2. imports:

    # from sktime_dl.classifiers import CNNClassifier # does not work
    # from sktime_dl.classification import CNNClassifier # does not work
    from sktime_dl.classifiers.deeplearning import CNNClassifier

This rises the error:

[/usr/local/lib/python3.7/dist-packages/sktime_dl/classifiers/deeplearning/_cnn.py](https://localhost:8080/#) in <module>
     17 __author__ = "James Large"
     18 
---> 19 import keras
     20 import numpy as np
     21 import pandas as pd

ImportError: cannot import name 'check_X_y' from 'sktime.utils.validation' (/usr/local/lib/python3.7/dist-packages/sktime/utils/validation/__init__.py)

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

Any hints are appreciated. yby.

aman-agar commented 2 years ago

Hey! I think I have found a solution for this. Try using: from sktime.classification.deep_learning import CNNClassifier It worked for me.

fkiraly commented 9 months ago

Obsolete since migration to sktime - indeed the solution is as @aman-agar says, using the migrated version.