autonomio / talos

Hyperparameter Experiments with TensorFlow and Keras
https://autonom.io
MIT License
1.62k stars 269 forks source link

datasets attribute is not included with installation #376

Closed jojker closed 4 years ago

jojker commented 4 years ago

The examples cannot run because they rely on the datasets attribute of the talos module, and this attribute is not included with the installation. At least this is true on colab.

Go to the example: https://colab.research.google.com/github/autonomio/talos/blob/master/examples/Hyperparameter%20Optimization%20with%20Keras%20for%20the%20Iris%20Prediction.ipynb

Before running add a new first cell containing only:

!pip install talos

When trying to run all, the code cell containing x, y = ta.datasets.iris() will result in the following error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-faca1cdc0697> in <module>()
----> 1 x, y = ta.datasets.iris()

AttributeError: module 'talos' has no attribute 'datasets'

The full code to copy into an arbitray notebook on colab is (you may try restarting the runtime and running a second time with the requirements installed):

!pip install talos
import talos as ta
import pandas as pd
x, y = ta.datasets.iris()
jojker commented 4 years ago

The examples need work if anyone is to learn talos from nothing.

I used a work around (just used wget to fetch the datasets.py file). However, most other things in the example are also broken. ta.Scan does not work (the downsampling feature is broken as in issue #299). Changing to the daily-dev (and changing the names of input arguments) fixes issue #299 but leaves more things broken. Commands like r.high() do not function with the latest version (it now requires inputs), and none of the plotting functions will display (which may be an astetik failure in colab). The evaluate section includes the average='macro' argument which does not exist in the daily-dev version.

EDIT: the plotting functions work if you enter these commands at the beginning:

import seaborn as sns
sns.set()
mikkokotila commented 4 years ago

For now, my recommendation is to use a >=0.6.2 version and refer to the examples in the docs. But you are right, the notebook examples need to be synced with the latest version. Some of those were done very early in Talos development.

mikkokotila commented 4 years ago

Regarding datasets, the way to access that is:

talos.templates.datasets.iris() as it is explained in the templates section of the docs.

mikkokotila commented 4 years ago

Closing here as this is resolved.