Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples won't run #84

Open
VladPerervenko opened this issue Apr 16, 2023 · 2 comments
Open

Examples won't run #84

VladPerervenko opened this issue Apr 16, 2023 · 2 comments

Comments

@VladPerervenko
Copy link

Hi, very interesting package. But..
Examples and documentation do not correspond to the release. Can you provide at least some examples?
`
(carefree) C:\Users\User>python
Python 3.9.16 (main, Mar 8 2023, 10:39:24) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import cflearn
import numpy as np

x = np.random.random([1000, 10])
y = np.random.random([1000, 1])
m = cflearn.api.fit_ml(x, y, carefree=True)
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in :1 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: fit_ml() got an unexpected keyword argument 'carefree'
m = cflearn.api.fit_ml(x, y)
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in :1 │
│ │
│ C:\Users\User\AppData\Local\r-miniconda\envs\carefree\lib\site-packages\cflearn\api\api.py:537 │
│ in fit_ml │
│ │
│ 534 │ │ processor_config, │
│ 535 │ ) │
│ 536 │ fit_kwargs = dict(sample_weights=sample_weights, cuda=cuda) │
│ ❱ 537 │ return MLTrainingPipeline.init(valid_config).fit(data, **fit_kwargs) # type: ignore │
│ 538 │
│ 539 │
│ 540 def repeat_ml( │
│ │
│ C:\Users\User\AppData\Local\r-miniconda\envs\carefree\lib\site-packages\cflearn\pipeline\core.py │
│ :78 in init │
│ │
│ 75 │ │
│ 76 │ @classmethod
│ 77 │ def init(cls: Type[TPipeline], config: DLConfig) -> TPipeline: │
│ ❱ 78 │ │ config.sanity_check() │
│ 79 │ │ self: Pipeline = cls() │
│ 80 │ │ self.config = config.copy() │
│ 81 │ │ self._defaults = OrderedDict() │
│ │
│ C:\Users\User\AppData\Local\r-miniconda\envs\carefree\lib\site-packages\cflearn\schema.py:1814 │
│ in sanity_check │
│ │
│ 1811 class DLConfig(Config, _DLConfig): │
│ 1812 │ def sanity_check(self) -> None: │
│ 1813 │ │ if not self.model_name: │
│ ❱ 1814 │ │ │ raise ValueError("model_name should be provided") │
│ 1815 │
│ 1816 │
│ 1817 @DataClass
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: model_name should be provided`

@carefree0910
Copy link
Owner

Ah, my bad, I forgot to maintain the document! 🤣

Recently I made massive refactors and bumped the version from v0.3.x -> v0.4.x. I updated the README.md but I forgot about the document.

Here's the demo on README:

import cflearn
import numpy as np

x = np.random.random([1000, 10])
y = np.random.random([1000, 1])
config = cflearn.DLConfig(model_name="fcnn", model_config=dict(input_dim=10, output_dim=1), loss_name="mae")
m = cflearn.api.fit_ml(x, y, config=config)

which should be running!

@VladPerervenko
Copy link
Author

Yes, it did. Hope you update the documentation soon. A very interesting way to use ONNX.
Good luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants